From bff3543546f1afb9dde7458119663b0fce291f94 Mon Sep 17 00:00:00 2001 From: "Bob White (Zen3 Infosolutions America Inc)" Date: Thu, 22 Mar 2018 10:34:30 -0700 Subject: [PATCH] Updated SQLRUserGroup Permissions --- Resources/ActionScripts/CreateDatabase.sql | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Resources/ActionScripts/CreateDatabase.sql b/Resources/ActionScripts/CreateDatabase.sql index 9de8a06..7b6492b 100644 --- a/Resources/ActionScripts/CreateDatabase.sql +++ b/Resources/ActionScripts/CreateDatabase.sql @@ -123,7 +123,7 @@ BEGIN ----Give SQLRUserGroup Rights To Database(s) SET @Qry = ' - USE [] + USE [] CREATE USER [] FOR LOGIN [] ALTER USER [] WITH DEFAULT_SCHEMA=NULL @@ -133,8 +133,14 @@ BEGIN ALTER AUTHORIZATION ON SCHEMA::[db_datawriter] TO [] ALTER AUTHORIZATION ON SCHEMA::[db_ddladmin] TO [] + + ALTER ROLE [db_datareader] ADD MEMBER [] + + ALTER ROLE [db_datawriter] ADD MEMBER [] + + ALTER ROLE [db_ddladmin] ADD MEMBER [] ' - SET @Qry = REPLACE(REPLACE(@qry,'', @ui),'',@DbName) + SET @Qry = REPLACE(REPLACE(@qry,'', @ui),'',@DbName) EXEC (@Qry) --SELECT @Qry