Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004

    Unanswered: Disable Triggers (using alter with public)

    Hey folks,

    Here's the skinny
    I'm trying to run a stored procedure that requires triggers to be disabled in a table.

    When I run the stored procedure (from the app or from the query analyzer) it works fine cause I'm setup as the owner/admin.
    However, when users call the stored procedure from the application it gets executed as public which does not have alter persmissions.
    I do not want to give alter permissions to public (for obvious reasons).

    I was thinking of using SETUSER and SETOWNER but I don't know if it will work (I think because I cannot upgrade permissions using these just change to user of equal or lesser permissions).

    Someone had mentioned to me to create a sysadmin user and just SETUSER to that then set it back to public, but again not sure if this will work because public has less permissions than the sysadmin.

    I would like to have more info before I try this out and give it back to the client for testing.
    Not sure if any of this will work for me, please help.
    Thank you for your time.

    By the way, I'm using SQL2000

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    My suggestion would be to code an exemption for that stored procedure into your trigger, something like:
    IF 'myProc' = Object_Name(@@procid)

  3. #3
    Join Date
    Nov 2004
    Perfect, Exactly what I was looking for.
    Thanks a million.

Posting Permissions

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