Evenimente
31 mar., 23 - 2 apr., 23
Cel mai mare eveniment de învățare SQL, Fabric și Power BI. 31 martie – 2 aprilie. Utilizați codul FABINSIDER pentru a economisi 400 USD.
Înregistrați-vă astăziAcest browser nu mai este acceptat.
Faceți upgrade la Microsoft Edge pentru a profita de cele mai noi funcții, actualizări de securitate și asistență tehnică.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
This topic describes how to create an application role in SQL Server by using SQL Server Management Studio or Transact-SQL. Application roles restrict user access to a database except through specific applications. Application roles have no users, so the Role Members list is not displayed when Application role is selected.
Important
Password complexity is checked when application role passwords are set. Applications that invoke application roles must store their passwords. Application role passwords should always be stored encrypted.
In This Topic
Before you begin:
To create an application role, using:
Requires ALTER ANY APPLICATION ROLE permission on the database.
In Object Explorer, expand the database where you want to create an application role.
Expand the Security folder.
Expand the Roles folder.
Right-click the Application Roles folder and select New Application Role....
In the Application Role - New dialog box, on the General Page, enter the new name of the new application role in the Role name box.
In the Default Schema box, specify the schema that will own objects created by this role by entering the object names. Alternately, click the ellipsis (...) to open the Locate Schema dialog box.
In the Password box, enter a password for the new role. Enter that password again into the Confirm Password box.
Under Schemas owned by this role, select or view schemas that will be owned by this role. A schema can be owned by only one schema or role.
Select OK.
The Application Role - New dialog box also offers options on two additional pages: Securables and Extended Properties.
The Securables page lists all possible securables and the permissions on those securables that can be granted to the login.
The Extended properties page allows you to add custom properties to database users.
In Object Explorer, connect to an instance of Database Engine.
On the Standard bar, click New Query.
Copy and paste the following example into the query window and click Execute.
-- Creates an application role called "weekly_receipts" that has the password "987Gbv876sPYY5m23" and "Sales" as its default schema.
CREATE APPLICATION ROLE weekly_receipts
WITH PASSWORD = '987G^bv876sPY)Y5m23'
, DEFAULT_SCHEMA = Sales;
GO
For more information, see CREATE APPLICATION ROLE (Transact-SQL).
Evenimente
31 mar., 23 - 2 apr., 23
Cel mai mare eveniment de învățare SQL, Fabric și Power BI. 31 martie – 2 aprilie. Utilizați codul FABINSIDER pentru a economisi 400 USD.
Înregistrați-vă astăziInstruire
Modul
Implement Role-based Security in finance and operations apps - Training
Finance and operations apps use role-based security to assign access to components in the system. A user who is assigned to a security role has access to the set of privileges that is associated with that role.
Certificare
Certificat Microsoft: Asociat administrator bază de date Azure - Certifications
Administrați o infrastructură de bază de date SQL Server pentru baze de date în cloud, locale și relaționale hibride utilizând ofertele de baze de date relaționale Microsoft PaaS.
Documentație
Grant a Permission to a Principal - SQL Server
Learn how to grant permission to a principal in SQL Server by using SQL Server Management Studio or Transact-SQL, including best practices.
Learn how to assign roles to logins and database users in SQL Server by using SQL Server Management Studio or Transact-SQL. Use roles to manage permissions.
Create a Server Role - SQL Server
Create a server role in SQL Server by using SQL Server Management Studio or Transact-SQL. Review limitations, restrictions, and necessary permissions.