Created
March 24, 2015 13:30
-
-
Save anzekrpic/dbea72a0b0d4e7190b46 to your computer and use it in GitHub Desktop.
Template for creating login and user
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
CREATE LOGIN [<SQL_login_name, sysname, login_name> ] | |
WITH PASSWORD = N'<password, sysname, Change_Password>'; | |
GO | |
CREATE USER [<SQL_login_name, sysname, login_name> ] FOR LOGIN [<SQL_login_name, sysname, login_name> ] WITH DEFAULT_SCHEMA=[dbo] | |
GO | |
EXEC sp_addrolemember 'db_datareader', '<SQL_login_name, sysname, login_name> '; | |
EXEC sp_addrolemember 'db_datawriter', '<SQL_login_name, sysname, login_name> '; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment