Msg Box to Run SQL Trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • barbarao
    New Member
    • Apr 2013
    • 82

    Msg Box to Run SQL Trigger

    Hi, Split Access FE and SQL Server2008 BE. There is a trigger on a table to copy data after update to another table. I want to have the user prompted if the copy should happen. Can I use a msg box with a tirgger somehow? thanks.
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    To the best of my knowledge, a Trigger is an automatic response to an UPDATE, INSERT, or DELETE operation and there is no way to prompt for its execution. Don't take this as gospel truth; see what others have to say on this matter.

    Comment

    • barbarao
      New Member
      • Apr 2013
      • 82

      #3
      Yes, that is what a trigger is. I was just hoping someone might be able to help me to figure out what I can do...the trigger copies a record and moves it to a history table after update. I want the user to tell the DB when a copy should be moved to the history table.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        What if you add a required column so that the user had to choose yes or no beforehand if they wanted to copy to the history table?

        Comment

        • barbarao
          New Member
          • Apr 2013
          • 82

          #5
          That might just work. How would the trigger know the yes or no?

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            It would know it because the user would have to fill it out. So the trigger can check what value is being inserted before running the sql to create a copy.

            Comment

            • barbarao
              New Member
              • Apr 2013
              • 82

              #7
              I'll try to figure out the code for that. Thanks!

              Comment

              Working...