Reading SQL Server error messages carefully means using number, severity, state, and line to narrow the cause before searching.
SQL SERVER – 2005 – Find Highest / Most Used Stored Procedure
Which stored procedure runs most often? My small SQL Server 2005 script finds the most used stored procedure, with execution count, worker time and calls per second.
SQL SERVER – Introduction to Live Lock – What is Live Lock?
What is Live Lock in SQL Server? How a write request can keep waiting behind a stream of reads, how it differs from a deadlock and how to reduce it.
SQL SERVER – Add Column With Default Column Constraint to Table
Add a NOT NULL column with a named default Column Constraint in one ALTER TABLE statement. I always name constraints instead of letting SQL Server pick one.
Simple CASE and NULL: Use a Searched Condition
Simple CASE and NULL do not match through equality. Use a searched IS NULL branch, preserve empty text, and make the result type explicit.
Porting Stored Procedures Between Platforms
Porting stored procedures means preserving error, transaction, temporary-table, sequence, and date behavior instead of translating tokens.
SQL SERVER – 2005 – Retrieve Any User Defined Object Details Using sys objects Database
The sys.objects catalog view has a row for every schema-scoped object, so you can retrieve any user defined object details, like foreign keys, by object type.






