1
0
mirror of https://github.com/Microsoft/sql-server-samples.git synced 2025-12-08 14:58:54 +00:00
Files
sql-server-samples/samples/features/security/contoso-clinic/setup/Create-Application-Login.sql
2016-08-04 11:52:16 -07:00

10 lines
520 B
SQL

-- Create a non-sysadmin account for the application to use
CREATE LOGIN [ContosoClinicApplication] WITH PASSWORD = <enter a strong password here>
CREATE USER [ContosoClinicApplication] FOR LOGIN [ContosoClinicApplication]
EXEC sp_addrolemember N'db_datareader', N'ContosoClinicApplication'
EXEC sp_addrolemember N'db_datawriter', N'ContosoClinicApplication'
GRANT VIEW ANY COLUMN MASTER KEY DEFINITION TO [ContosoClinicApplication]
GRANT VIEW ANY COLUMN ENCRYPTION KEY DEFINITION TO [ContosoClinicApplication]