You can ORDER BY a column alias, so why not use it in WHERE? A simple example that shows how SQL Server assigns a Column Alias and where it is in scope.
SQL SERVER – How to Enable or Disable All the Triggers on a Table and Database?
One line commands to enable or disable all the triggers on a table, a database or the whole server using ENABLE TRIGGER ALL and DISABLE TRIGGER ALL.
SQL SERVER – SPID is KILLED/ROLLBACK state. What to Do Next?
Your SPID shows KILLED/ROLLBACK and never seems to finish. Here is what that state means, why SQL Server sometimes cannot undo the work and what to do next.
SQL SERVER – Script: Finding queries without JOIN Predicates
During a code review I spotted a query missing its join condition. Here is a script for finding queries without JOIN predicates in SQL Server.
SQL SERVER – How to Migrate Existing Database to Contained Databases
How do you convert an existing database to contained databases? I walk through the planning and use the DMV and XEvent that flag containment breaches.






