In this post, we’ll demonstrate the process of adding a new filegroup to a database in SQL Server. While many databases function efficiently with a single data/log file, there are scenarios where adding a filegroup proves beneficial. Filegroups, as outlined […]
Why Use WHERE 1=2 in SQL
In my last post, we discussed the usefulness of WHERE 1=1 in SQL queries. This time, let’s explore the purpose behind using WHERE 1=2 – a statement that evaluates to false. Similar to WHERE 1=1, this technique can be applied […]
WHERE 1=1 in SQL Queries
When delving into SQL queries, you may come across the puzzling WHERE clause condition: WHERE 1=1. This leaves many wondering, why use it, and what purpose does it serve? Understanding WHERE 1=1 The condition WHERE 1=1 essentially translates to WHERE […]
SQL Server: Deleting Rows in Batches
Deleting a large amount of data from a SQL Server table can be a resource-intensive task. Whether it’s for routine maintenance or data cleanup, managing the deletion process efficiently becomes crucial for maintaining database performance. In this blog post, we’ll […]
SQL Server Script: Kill All User SPIDs
Database administrators often encounter scenarios where they need to terminate all user sessions or processes (SPIDs) in a specific database. This may be necessary during maintenance tasks, troubleshooting (dropping a database), or other critical database operations. In this blog post, […]
Create a Test Database in SQL Server
As a SQL Server DBA and blogger, creating a test database with data often needed for preparing tests and demos. You might also need this for testing a SQL Server feature or script before rolling out to Production. The SQL […]