Last active
April 13, 2018 16:11
-
-
Save Alexisvt/d10969f84ffabf80ffc9854c451e2989 to your computer and use it in GitHub Desktop.
SQL query for create a sql user for the database
This file contains hidden or 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 should execute in the database that you want to assign this user | |
CREATE USER webappuser | |
FOR LOGIN webappuser | |
GO | |
EXEC sp_addrolemember N'db_datareader', N'webappuser' | |
EXEC sp_addrolemember N'db_datawriter', N'webappuser' | |
EXEC sp_addrolemember N'db_ddladmin', N'webappuser' | |
GO |
This file contains hidden or 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
-- We need to execute this query in master database in order to assign it to others databases | |
CREATE LOGIN sampleuser WITH PASSWORD = 'yourpassword' GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment