Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    2

    Unanswered: sp_dropuser multiple usage

    Hello there,

    I am trying to work out a way to drop multiple users from the current database. I can use sp_dropuser but the limitation is one name_in_db at a time.
    Have attempted to use cursors but get the following error,
    "The procedure 'sp_revokedbaccess' cannot be executed within a transaction."
    Any suggestions how i can overcome this hurdle.

    Many thanks in advance.

    Leo

  2. #2
    Join Date
    Jun 2003
    Location
    cape town, south africa
    Posts
    102
    "sp_revokedbaccess cannot be executed from within a user-defined transaction." BOL

    Have you defined begin tran?
    If not do you have Implicit Transaction set on?

  3. #3
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    select 'exec sp_dropuser '+name from sysusers where issqlrole = 0 and name not in ('dbo','guest')
    order by name
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •