-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update create_login.sql to be templated based on ko_db argument.
- Loading branch information
Showing
2 changed files
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
USE [master] | ||
IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N'kodb_user') | ||
DROP LOGIN [kodb_user]; | ||
CREATE LOGIN [kodb_user] WITH PASSWORD=N'kodb_user', DEFAULT_DATABASE=[kodb], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=ON; | ||
IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N'###DB_NAME###_user') | ||
DROP LOGIN [###DB_NAME###_user]; | ||
CREATE LOGIN [###DB_NAME###_user] WITH PASSWORD=N'###DB_NAME###_user', DEFAULT_DATABASE=[###DB_NAME###], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=ON; | ||
GO | ||
|
||
USE [kodb] | ||
IF EXISTS (SELECT * FROM sys.database_principals WHERE name = N'kodb_user') | ||
DROP USER [kodb_user]; | ||
CREATE USER [kodb_user] FOR LOGIN [kodb_user]; | ||
EXEC sp_addrolemember N'db_owner', N'kodb_user'; | ||
USE [###DB_NAME###] | ||
IF EXISTS (SELECT * FROM sys.database_principals WHERE name = N'###DB_NAME###_user') | ||
DROP USER [###DB_NAME###_user]; | ||
CREATE USER [###DB_NAME###_user] FOR LOGIN [###DB_NAME###_user]; | ||
EXEC sp_addrolemember N'db_owner', N'###DB_NAME###_user'; | ||
GO |