Wednesday, September 11, 2013

Multiple ALTER Trigger Statements SQL Server

I was trying to update multiple triggers in a single job step. The solution took me a while to come up with so I thought I would throw it in here. When running mulitple dynamic ALTER TRIGGER statements you quickly discover that you lose context. By using the sp_executesql stored procedure and specifying the database name you can preserv context during each execution.



0 comments:

Post a Comment