Skip to content

Instantly share code, notes, and snippets.

@runes83
Created January 29, 2020 10:17
Show Gist options
  • Select an option

  • Save runes83/6a4cf5d46c9f8ad24cfb33899fa15fbf to your computer and use it in GitHub Desktop.

Select an option

Save runes83/6a4cf5d46c9f8ad24cfb33899fa15fbf to your computer and use it in GitHub Desktop.
# Master database:
CREATE LOGIN SQLUSER
WITH PASSWORD = 'Password123'
GO
# Service database:
-- For login <login_name, sysname, login_name>, create a user in the database
CREATE USER SQLUSER
FOR LOGIN SQLUSER
-- Add user to the database owner role
EXEC sp_addrolemember db_datareader, communicationSql
EXEC sp_addrolemember db_datawriter, communicationSql
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment