Thursday, July 25, 2013

Grant Execute Permission on Schema Level To User

--Create The Login

Use master

CREATE LOGIN [SchemaLevelPermission] WITH PASSWORD=N' ¦]è}ÕGpÆå¡Kƒ¼_
çÅDEFAULT_DATABASE=[master],
DEFAULT_LANGUAGE=[us_english],
CHECK_EXPIRATION=OFF,
CHECK_POLICY=ON
GO


-- Create The User


USE [AdventureWorks2008R2]
GO
CREATE USER [SchemaLevelPermission] FOR LOGIN [SchemaLevelPermission]
GO

-- Create Database Roles

USE [AdventureWorks2008R2]
GO

CREATE ROLE [DBR_SchemaLevelPermission] AUTHORIZATION [dbo]
GO


-- Grant Execute Permission on Schema Level To User

use [AdventureWorks2008R2]
GO
GRANT EXECUTE ON SCHEMA::[HumanResources] TO [SchemaLevelPermission]
GO


No comments: