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 emergency? Email pinal@sqlauthority.com with URGENT in the subject line.
SQL SERVER – Identify Time Between Backups Calculation
A DBA whose latest tape backup was corrupt wanted to know the possible data loss. This script uses backup history to calculate the time between backups.
Interview Question of the Week #035 – Different Ways to Identify the Open Transactions
Identify open transactions with modern SQL Server DMVs, inspect sleeping owners and recent SQL, and verify a two-window transaction demo.
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 – Configure the Backup Compression Default Server Configuration Option
Backup compression is off by default. Here is how to view or configure the backup compression default server option using SSMS or Transact-SQL.
Rank Your Work: Only One Task Can Be Number One
Rank your work every morning, and give each task its own place. A priority list with five items marked high is a pile, not a plan. This post shows how to number your tasks, break ties with a rule and re-rank when something real arrives.
SQL SERVER – FIX – Error: Alter failed for Server ‘Server Name’ in Check Integrity task
My CHECKDB maintenance plan failed with Alter failed for Server in the Check Integrity task. Profiler led me to sp_configure and a recovery interval problem.
SQL Server slow? Let's fix it together in about four hours.
In my Comprehensive Database Performance Health Check, you share your screen, I guide you, and we fix your biggest performance troublemakers. No passwords. No remote access.
You keep every script, and the know-how to fix it yourself next time.
Want your whole team to learn it?
My Practical Workshop has no PowerPoint, just live demos. My AI Enablement Workshop shows your team where AI saves hours, and where it quietly costs them.
Over 400 customers have worked with me this way, and not one shared a password. See all consulting options.
Who We Are
Pinal Dave is an SQL Server Performance Tuning Expert and independent consultant with over 24 years of hands-on experience. He holds a Masters of Science degree and numerous database certifications.
Pinal has authored 19 books and 125 Pluralsight courses. To freely share his knowledge and help others build their expertise, Pinal has also written more than 5,800 database tech articles on his blog at https://blog.sqlauthority.com.
Pinal is also a CrossFit Level 1 Trainer (CF-L1) and CrossFit Level 2 Trainer (CF-L2).
Nupur Dave is a social media enthusiast and an independent consultant. She primarily focuses on the database domain, helping clients build short and long-term multi-channel campaigns to drive leads for their sales pipeline.
Shaivi Pinalkumar Dave is a book author and a women’s artistic gymnast.

