Tag: SQL Interview Questions
-
Understanding WHERE 1=1 and WHERE 1=2 in SQL Queries
⚡Neither changes the plan or the speed of a query. WHERE 1=1 lets every real condition start with AND, so conditions can be commented out or appended in dynamic SQL. WHERE 1=2 returns no rows without reading the table, which is how SELECT … INTO copies a table’s columns and nothing else. You have opened…
Written by
Major pillars
Quick scripts
Patch week
Health check & AI
Script areas
Latest posts
- Tune a Slow Query With Copilot in SSMS
- xp_readerrorlog: Read the SQL Server Error Log with T-SQL
- Cannot Drop Database Because It Is Currently in Use (Error 3702)
- Could Not Drop Login Because the User Is Currently Logged In (Error 15434)
- Set a Maximum Database File Size in SQL Server (MAXSIZE)
- SQL Server Activity Monitor in SSMS (and the Performance Dashboard)
Browse by topic
- Backups & Recovery (18)
- DBA Scripts (154)
- High Availability (HA) (13)
- Installation & Configuration (60)
- Maintenance (25)
- Migration & Upgrades (14)
- Monitoring (10)
- Performance Tuning (38)
- Security (Encryption & Permissions) (25)
- Storage & Capacity (18)
- T-SQL Fundamentals (17)
- Troubleshooting (108)
- Wait Types (236)