Executing the procedure with parameters @DBNAME = 'database_name' , @USERS = 'ALL' and @EXCEPT = 'list_user_exception' deletes all users from the specified database excepting the users specified in the @EXCEPT parameter.

Example:

EXEC REMOVE_USERS_2000_and_2005 @DBNAME ='Products', @USER = 'ALL', @EXCEPT = 'user_cmd,cris,lex'
GO


Results:



Note: The @EXCEPT parameter must be used only with @USER = 'ALL'