Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    4

    Unanswered: Using stored procedure sp_helpuser in a triggers

    Hi,

    I would like to create a trigger and using the stored procedure sp_helpuser. The reason is that I want to pass the role to this stored procedure so it gives me the list of users in that role. And so,
    with that list of users, I want to check with the triggers if the user added is in that list. The problem is that the sp_helpuser stored procedure returns me a bool and output the results... What I would like is to "save" the output in a variable so I can use and compare it to the inserted table...

    I would like to know if that solution is possible and if not, is there any better solution.

    Thanks!

  2. #2
    Join Date
    Sep 2003
    Location
    KY
    Posts
    146

    Thumbs up OK here

    Create table tmp(Username varchar(50),GroupName varchar(50), LoginName Varchar(50),DefDbName varchar(60), userid int, SID varbinary)

    INSERT tmp Exec sp_helpuser

    Now you have the fields from sp_helpuser proc . I am not sure on what you plan on doing with trigger . A trigger won't fire unless data changes on a table

  3. #3
    Join Date
    Oct 2003
    Posts
    4

    Re: OK here

    Ok, I've tried it and it's working perfectly... Thanks a lot!

    Originally posted by aashu
    Create table tmp(Username varchar(50),GroupName varchar(50), LoginName Varchar(50),DefDbName varchar(60), userid int, SID varbinary)

    INSERT tmp Exec sp_helpuser

    Now you have the fields from sp_helpuser proc . I am not sure on what you plan on doing with trigger . A trigger won't fire unless data changes on a table

Posting Permissions

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