Still see Error 3702, cannot drop database because it is currently in use? Why closing Management Studio works and how to find the connection.
Top and Bottom Rows With a CTE in SQL Server: Part 2
Top and bottom rows with a CTE come from two ordered queries, one for each end of the table. This follow-up tests the reader’s single-CTE version and a two-CTE version on SQL Server 2025. It also compares a ROW_NUMBER version that read 336 pages against 4 for TOP, and shows what ties, empty tables and one-row tables return.
SQL SERVER – Find Nth Highest Record from Database Table
The fourth Highest Record depends on whether ties occupy separate places. I define the ranking rule before choosing a query.
ACID Properties Shown With Real Transactions
ACID properties shown With Real Transactions uses short SQL Server scripts to explain atomicity, consistency, isolation, and durability.
SQL SERVER – Simple Example of Cursor – Sample Cursor Part 2
A reader asked me to update my Simple Example of Cursor with AdventureWorks. Here is a sample cursor that loops through ProductID and prints each one.
CUBE: Include Every Two-Dimensional Subtotal Combination
CUBE requests every grouping combination of its dimensions, including independent subtotals and the grand total. I compare its output population with ROLLUP before choosing it. More subtotal families are useful only when the report needs them.







