|
USE myDB;
GO
---- Create a login using a Windows user
CREATE LOGIN [domain\windows_user] FROM WINDOWS WITH DEFAULT_DATABASE = myDB;
---- Add the user to the database using their login name and the user name
CREATE USER [domain\windows_user]
FOR LOGIN [domain\windows_user]
WITH DEFAULT_SCHEMA = Production;
GO
---- Grant specific access rights to use based on Schema
GRANT
DELETE,
EXECUTE,
INSERT,
SELECT,
UPDATE,
VIEW DEFINITION
ON SCHEMA::[Production]
TO [domain\windows_user];
|