SQL Server expert Dominic Wirth shares a script that gives a utilization overview of the local AlwaysOn replica server: database count and size, by role and group.
Which is Optimal – TOP 0 OR WHERE 1 = 2? – Interview Question of the Week #190
Which is optimal, TOP 0 or WHERE 1 = 2? Many interview answers get this wrong, but they are both the same, and STATISTICS IO shows why.
Alphabets – SQL SERVER – Retrieving Rows With All Alphabets From Alphanumeric Data
I got an email from one of my blog readers asking for an easy way to identify if a given string contains only alphabets. There can be methods.
SQL SERVER – Applying NOLOCK to Every Single Table in Select Statement – SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
READ UNCOMMITTED changes session read isolation without adding NOLOCK to every table. A workshop procedure made the distinction useful.
How to Move SQL Server MDF and LDF Files? – Interview Question of the Week #189
How do you move SQL Server MDF and LDF files? Detach and attach is the old way, so here is the step-by-step method I use for my clients today.
Rename Physical File Name of a SQL Server Database
To rename physical file name entries for a SQL Server database, take it offline, change the catalog with MODIFY FILE, rename the files in Windows and bring the database online. This post builds a demo, shows the error a missing file causes, and gives a way to undo the change.
Rename Logical File Name of a SQL Server Database
To rename logical file name entries in SQL Server, use ALTER DATABASE with MODIFY FILE and NEWNAME. This post builds a demo database, renames both files and checks the result. It also covers names with dots and the two errors that stop a rename.







