Created
October 22, 2019 14:57
-
-
Save martencassel/a9bf53a0cf9617059bad4108cbff34f9 to your computer and use it in GitHub Desktop.
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 database [$dbName]; | |
USE [master] | |
GO | |
CREATE LOGIN [$userName] WITH PASSWORD=N'$password', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=ON | |
GO | |
USE [$dbName] | |
GO | |
CREATE USER [$userName] FOR LOGIN [$userName] | |
GO | |
ALTER ROLE [db_datareader] ADD MEMBER [$userName] | |
GO | |
ALTER ROLE [db_datawriter] ADD MEMBER [$userName] | |
GO | |
ALTER ROLE [db_ddladmin] ADD MEMBER [$userName] | |
GO | |
GRANT EXECUTE TO [$userName] | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment