I just spent way too much time debugging some SQL Server code, only to discover that my results did not match my SQL statements because of a trigger that I was unaware of. How did I find this trigger? With the help of a wonderful built in stored procedure named SP_HELPTRIGGER. The following lists all triggers associated with table myTable, along with the events they are associated with, and whether they are AFTER or INSTEAD OF:
SP_HELPTRIGGER myTable;

3 thoughts

  1. This is the main reason I don’t even like to use them. When you hit a snag you totally forget you set it up in the first place. However, they do have a place in the scheme of things and can be valuable in some cases. Like you said in another blog entry, use the database for what it was designed for.

  2. Do you have any suggestions on a book about SQL Server for someone needing to change over from Access to SQL Server?
    (note SQL Server is the only option besides Access offered by my IT department)

  3. Doug, this one is a bit dated (it was written for SQL Server 2000), but you might want to try ‘Microsoft Access Developer’s Guide To SQL Server’.
    — Ben

Leave a Reply