Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    May 2008
    Posts
    5

    Unanswered: Trigger Question

    Is it possible to enable/disable triggers for a single SPID? For example: I want to perform an action without triggers, but everyone else should still have triggers enabled....

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    You could have the trigger read SUSER_NAME and act based on that...

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Now you've got me curious...what does the trigger do?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    May 2008
    Posts
    5
    Quote Originally Posted by blindman
    Now you've got me curious...what does the trigger do?
    Nothing too interesting. Upon an insert/update/delete a snapshot is taken of the row and moved to an archive table.

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    But you want to be able to break the transaction history for the records?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  6. #6
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Here we go again with trigger business...when is it gonna stop???
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  7. #7
    Join Date
    May 2008
    Posts
    5
    Quote Originally Posted by blindman
    But you want to be able to break the transaction history for the records?
    Yes, there are several situations where we don't want triggers to fire. Most common is data migration or cleaning up in a development environment.

  8. #8
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I cannot think of any valid reason for intentionally creating gaps in an archive history.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  9. #9
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    He wants to skim the half-pennies from the financial transactions without an audit trail ... sort of like whay Richard Prior did in SUPERMAN 4.

    -- This is all just a Figment of my Imagination --

  10. #10
    Join Date
    May 2008
    Posts
    5
    Quote Originally Posted by blindman
    I cannot think of any valid reason for intentionally creating gaps in an archive history.
    no gaps are being created. a better example would be moving a record from one database to another. (load balancing) The archive records already exist so we don't need triggers to fire again, just moved. Its a pretty rare scenario, but it does happen from time to time. We are talking 150+ tables here so it gets a little tricky.

  11. #11
    Join Date
    May 2008
    Posts
    5
    Quote Originally Posted by tomh53
    He wants to skim the half-pennies from the financial transactions without an audit trail ... sort of like whay Richard Prior did in SUPERMAN 4.
    I think a better example would be Office Space

  12. #12
    Join Date
    Feb 2004
    Location
    Burbank & Santa Cruz de la Sierra
    Posts
    3,716
    Quote Originally Posted by rdjabarov
    Here we go again with trigger business...when is it gonna stop???
    Just for that I'm going to add triggers to a database that doesn't have any yet.
    aka "Paul"
    Non est ei similis.

    I just read "100 Things To Do Before You Die". I was surprised that "Yell for help!!" wasn't one of them

  13. #13
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Quote Originally Posted by TallCowboy0614
    Just for that I'm going to add triggers to a database that doesn't have any yet.
    Spoke like a true developer
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  14. #14
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    I know you'll all be laughing, but I just got a project, that is...fully based on triggers!!! I wish I could send it your way, TallCowboy
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  15. #15
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Fully based? You mean, instead of sprocs or views?
    That is rich.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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