Posts related to SQL Server topics, divided to more subcategories by topic focus
List all constraints created in database tables including their definition. Very quick overview of data integrity helpers called constraints.
HINT: Add where clause to focus on particular tables only....
Check what partitions are you using in the database. Super-useful script to quickly list all partitioned tables with information about file groups, partition schemas and partition functions.
HINT: Add where clause...
Generate heavy load over AdventureWorks database. Script from "AdventureWorks" sample database querying series. You can use this on for some testing purposes. It is pretty long running and heavy query...
This is risky! Be aware of doing this on some production database. This script is published for training purposes only. Use it with caution, this will definitely break your database,...
Generate script to grant permission quickly in more tables within database. Change Tracking is a lightweight solution that provides an efficient change tracking mechanism for applications. It is configured on...
Identify top waits occurring in SQL Server. Handy script with links to detailed information about given wait. Links pointing to great SQL Server Wait Type Library from SQLSkills.com. You will...
Check which index's maintenance is taking most time. Short script to answer this question. It is part of script series related to popular Ola Hallengren's maintenance solution. If you are...
Quick way to change tempdb files location. This is very useful script copied from Brent Ozar. From time to time there is need to move tempdb files to new location....
Identify build number of your SQL Server cut into parts. You can use it in scripting or in automation use cases. More information about build numbers. This piece of code...
Check what stored procedures are loading your SQL Server the most. Nice and simple analytical query to check which stored procedures are running most times. Its like small procedures competition...