GRANT VIEW or GRANT VIEW ANY PERMISSION

/*
 This permision(SP_HELPTXT) is only on those particular databases
 and those particular logins only
*/

USE Database1
GO 
GRANT VIEW  DEFINITION TO [Domain\User1]
GRANT VIEW  DEFINITION TO [Domain\User2]
go
USE Database2
GO 
GRANT VIEW  DEFINITION TO [Domain\User1]
GRANT VIEW  DEFINITION TO [Domain\User2]

/*
Granting VIEW(SP_HELPTEXT) permissions to on ALL databases in that server
and to this account only
*/

USE master
GO 
GRANT VIEW ANY DEFINITION TO USER1
The below command will give ALTER,CONTROL and VIEW DFFINITION permissions on a sepcific database.
USE Test
GO
/*
 The below commands will give you
 Modify or ALTER Stored procedure and see the text 
 of the logical objects which are created with dbo
*/
GRANT ALTER ON SCHEMA::dbo
TO LoginName
GRANT CONTROL ON SCHEMA::dbo
TO LoginName
GRANT VIEW DEFINITION ON SCHEMA::dbo
TO LoginName

Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server