Detach and Reattach a Database
Overview Occasionally you may want to detach a database while you perform some operation on the SQL Server instance, then re-attach the database after you’ve finished. One such example might be when modifying the SQL…
Find-and-Replace for SQL Server Agent Jobs
Once in a while you might need to make common changes to a lot of SQL Server Agent Jobs. For example, if you change the path where you store SQL Server backup files, you might…
Slow inserts across a linked server?
Linked Servers offer a great way to connect two SQL Servers together, allowing remote querying and DML operations. Frequently, this is used to copy data from production to reporting. However, the temptation is to run…
Does dm_db_stats_properties track statistics properties for “small” tables?
A recent question on dba.stackexchange.com about statistics properties asked the following: dm_db_stats_properties does not keep track of small tables? what is the work around to find the number of records in the table? The question…
Update Statistics on a Columnstore index failed
SQL Server relies upon good, up-to-date statistics when creating query execution plans. Out-of-date statistics can cause queries to run slowly, or suddenly start consuming far more resources than is typically required. Columnstore statistics are quite…
Transaction Log Structure
Intro This post shows the internal logical structure of the SQL Server Transaction Log. The details here target SQL Server 2000 to 2017. Note that SQL Server 2019 will likely include Accelerated Database Recovery, aka…