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-09-07 14:13:12 -07:00

13 lines
536 B
Transact-SQL

use Clinic;
go
-- 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]