sqlserver

Triggers can be really useful in your database but you have to be careful with them. We often use them to record history to a separate table (at least, until we can implement temporal tables) or keep track of when a record was last updated. It’s usually implemented via an AFTER UPDATE trigger. Several times…

Read More Triggers vs. Default Constraints: Choose Wisely

This month’s T-SQL Tuesday is hosted by Raul Gonzalez and he’s asked everyone to share things we might be a bit embarrassed about: For this month, I want you peers to write about those important lessons that you learned the hard way, for instance something you did and put your systems down or maybe something…

Read More T-SQL Tuesday #92: Lessons Learned the Hard Way

In a previous post, I expressed some frustration over Invoke-SqlCmd not setting an Application Name for its ODBC connection, leaving us with the generic .NET SqlClient Library when looking at active sessions in sp_who2 and sp_whoisactive (and any other monitoring tool). Unfortunately, I can’t really do anything about Invoke-SqlCmd aside from posting a suggestion on Connect or the…

Read More Adding Application Name to Invoke-SqlCmd2