SQL Server Administration - User/Login Admin

Drop User from a Database role

Drop a sql server user from a database role.

Syntax - SQL Server 2005/2008

sp_droprolemember [ @rolename = ] 'role' , 
     [ @membername = ] 'security_account'
GO 

--returns 0=ok 1=failed

Example - SQL Server 2005/2008

Adding a database user

The following example drops the database user ericm to the PROD database role.

EXEC sp_addrolemember 'PROD', 'ericm'
GO
 Collapse All    Expand All
Custom Search

SQL Server Information and Resources