How to Grant the Execute permission of xp_cmdshell to a user?

July 23, 2012

To Grant the Execute permission of xp_cmdshell to a user you have to execute the following command:

GRANT exec ON sys.xp_cmdshell TO [User]
GO

 


How to bring the database to Multi-User mode?

July 13, 2012

The below set of queries would bring the database to Multi-User mode:

USE master;
ALTER DATABASE <Database Name> SET MULTI_USER;
GO


How to bring the database to a Single User mode?

July 13, 2012

The below set of queries would bring the database to a single user mode:

USE master;
ALTER DATABASE <Database Name> SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO

ROLLBACK IMMEDIATE will bring the database to the single user mode immediately after rolling back the transactions.

 


Grant all the stored procedures to a User

June 27, 2012

To Grant the permission for all the stored procedures to a User we can use the following command:

USE <DatabaseName>
GO
GRANT EXECUTE to <User>;
GO

 


%d bloggers like this: