var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
I know that there is a way to drop a user from one database but not from another. Does sp_drop user do that? To be more specific, I want to drop all users (except for dbo) from one database but not from all others. Is that possible.
If you just wan´t to revoke access for a specific database you can run sp_revokedbaccess 'Username'. You must have selected the database in Query Analyzer first.
Be sure to execute in quary analyzer and in the database from where you want to drop the users.
declare @user_name as varchar(100)
DECLARE CUsers CURSOR FOR
SELECT name FROM MyTable..sysusers
where name <> 'dbo'
FETCH FROM CUsers INTO @User_Name
WHILE @@FETCH_STATUS = 0
EXEC sp_dropuser @User_Name
FETCH NEXT FROM CUsers INTO @User_Name
Log in with your username and password
Forgot your password?
Subscribe to dBforums Brief to receive special offers from dBforums partners and sponsors