Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitattributes sql lang detection Sep 24, 2018
AG - Am I Primary.sql cleanup and standardize naming for AG scripts Sep 10, 2018
AG - Health_XEvents.sql cleanup and standardize naming for AG scripts Sep 10, 2018
AG - Monitor.sql cleanup and standardize naming for AG scripts Sep 10, 2018
AG - PerfMon counters.sql cleanup and standardize naming for AG scripts Sep 10, 2018
AG - alerts.sql cleanup and standardize naming for AG scripts Sep 10, 2018
AG - check owner.sql
AG - extendedEvents_Create.sql cleanup and standardize naming for AG scripts Sep 10, 2018
AG - failover (in development).ps1 cleanup and standardize naming for AG scripts Sep 10, 2018
AG - post-zerto failover.ps1 initial checkin, work in progress still Sep 10, 2018
AG - readonly routing urls.sql cleanup and standardize naming for AG scripts Sep 10, 2018
README.md update readme Jan 4, 2018
Sharepoint Recovery Models.sql Rename Sharepoint Recovery Models to Sharepoint Recovery Models.sql Dec 19, 2017
add Agent Failure Notifications job.sql
add Agent Failure Notifications.sql rename for proper git sorting Nov 10, 2017
add database descriptions.sql initial Jul 20, 2017
add error event alerts.sql
audit setup.sql updated for better naming conventions Aug 10, 2018
autogrow change all 1mb growth files.sql minor tweak Jun 14, 2018
autogrow events.sql update date filter Oct 27, 2017
automated index rebuild old.sql Rename automated index rebuild 2012.sql to automated index rebuild ol… Sep 13, 2018
automated index rebuild.sql add options for compression, add SORT_IN_TEMPDB by default, improve f… Sep 13, 2018
avg disk secwrite.png
azure dtu usage every 15s.sql initial Jul 20, 2017
azure dtu usage every hour.sql add a second order by column Nov 20, 2017
azure sql db scale.ps1 initial add Aug 23, 2018
backup history oldest latest.sql
backup history.sql add database creation date to the query resultset Jul 30, 2018
backup readonly copy restore.sql add norecovery for future utility Jun 19, 2018
backup restore progress.sql initial Jul 20, 2017
backup to azure blob tsql script for legacy SQL.sql prep for generic use Jul 30, 2018
busy databases.sql encoding change Sep 10, 2018
checksum vs hashbytes.sql initial Jul 20, 2017
collect connections.sql initial Jul 20, 2017
compress indexes.sql initial Jul 20, 2017
configuration changes history.sql
cpu utilization.sql
database mail diag.sql improv comments, add utility Sep 12, 2017
database ownership.sql fix potential typo- wrap db name in brackets Jun 5, 2018
database settings info.sql
deadlocks in xevents.sql replace/rewrite Oct 3, 2017
defrag columnstore.sql better column aliases Jun 22, 2018
defrag.sql updates for all-dbs version, filtering, lab mention Sep 12, 2018
dependencies.sql initial Jul 20, 2017
deprecated usage counter.sql initial Jul 20, 2017
dimdate.sql sync Aug 30, 2017
dm_exec_query_memory_grants.sql
dm_exec_session_wait_stats.sql initial Jul 20, 2017
dm_os_performance_counters.sql
dm_os_wait_stats.sql sync Aug 30, 2017
dm_os_waiting_tasks.sql initial Jul 20, 2017
easy passwords.sql fixed issue with nonstandard collations Oct 25, 2017
endpoint owners.sql initial Jul 20, 2017
error log.sql
failover cluster force quorum.ps1 add Aug 23, 2018
find duplicate indexes.sql added space saved, formatting changes Dec 14, 2017
find memory mini dumps.sql rename for proper git sorting Nov 10, 2017
firstByte (working).sql rename for proper git sorting Nov 10, 2017
fix orphaned sid.sql
gather log events.ps1 reduce noise Sep 13, 2018
generate error tables.sql initial Jul 20, 2017
get disk block allocation size.ps1 initial Jul 20, 2017
guest permissions.sql initial Jul 20, 2017
index ALLOW_PAGE_LOCKS.sql
index_usage_stats.sql initial Jul 20, 2017
indirect checkpoints enable.sql
install failover clustering features.ps1 initial Sep 11, 2017
instant_file_initialization.sql initial Jul 20, 2017
job - Volume Stats Monitoring.sql datetimeoffset instead of datetime2 Feb 18, 2018
job - memory stats Monitoring.sql rename volume stat mon job, add memory mon job Feb 6, 2018
job - setup database audit.sql
job owners.sql better filter and sample data Sep 10, 2018
job status.sql initial Oct 16, 2017
kill detect blocking sessions setup.sql initial Jul 20, 2017
kill detect blocking spids job.sql initial Jul 20, 2017
kill detect blocking spids.sql initial Jul 20, 2017
lab - FORMATMESSAGE in SQL2016.sql rename/organize Nov 9, 2017
lab - TSQL 101.sql initial checkin, file for a SQL 101 talk at Activate Conference Feb 21, 2018
lab - TemporalTable demo.sql
lab - VLF generation example.sql
lab - azure blob storage retention plan.ps1
lab - backup to URL.sql
lab - basic error table.sql demonstrate issue with THROW only returning second (useless) error. Jul 30, 2018
lab - clustered key design.sql new file Feb 19, 2018
lab - concat_ws.sql update for lab demo Feb 15, 2018
lab - deadlock part 1.sql
lab - deadlock part 2.sql rename/organize Nov 9, 2017
lab - dynamic data masking.sql rename/organize Nov 9, 2017
lab - filetable demo.sql
lab - fragmented table int.sql
lab - fragmented table newsequentialid.sql update for dmv preso Sep 5, 2018
lab - fragmented table.sql update for dmv preso Sep 5, 2018
lab - implicit conversion.sql initial checkin Feb 20, 2018
lab - missing index setup demo.sql rename/organize Nov 9, 2017
lab - power of columnstore.sql
lab - pre2016 correct time zone conversion from UTC.sql index addition to DSTDates table for pre2016 use Jan 8, 2018
lab - replaceFloatWithDecimal.sql rename for proper git sorting Nov 10, 2017
lab - sql agent execution lab.sql rename/organize Nov 9, 2017
lab - tde encryption workshop 2014.sql add important caveat in comment Jun 22, 2018
lab - testing mem opt.sql consolidated diagnostic queries Feb 20, 2018
lab - time zone.sql rename/organize Nov 9, 2017
lab - translate syntax.sql initial checkin for 2017 demo syntax scripts Feb 14, 2018
lock Pages in Memory LPIM.sql
log_reuse_wait.sql initial add Jul 9, 2018
memory-optimized table memory usage.sql
missing indexes.sql updates for all-dbs version, filtering, lab mention Sep 12, 2018
modules vs routines.sql comment improvement Sep 26, 2017
move system databases.sql initial Jul 20, 2017
multiserver backup history.sql
multiserver space in files.sql initial Jul 20, 2017
my_permissions.sql make generic May 31, 2018
oledb providers.sql initial checkin of this script Jun 1, 2018
open transactions.sql
optimize for ad hoc workloads.sql initial Jul 20, 2017
overdue jobs.sql
page life expectancy.sql
public permissions.sql Update public permissions.sql Mar 6, 2018
rebuild SSRS RSExecRole permissions.sql
record_dm_io_virtual_file_stats.sql initial Jul 20, 2017
refresh view metadata.sql initial Jul 20, 2017
rename SQL instance.sql
reports catalog metadata.sql initial Jul 20, 2017
restore.sql rename/organize Nov 9, 2017
script ssisdb env.sql initial Jul 20, 2017
security Script databases.sql rename for proper git sorting Nov 10, 2017
security Script servers.sql rename for proper git sorting Nov 10, 2017
services dmv.sql sync Aug 30, 2017
sessions and requests blocking chain.jpg initial Jul 20, 2017
sessions and requests table.sql minor comments for retaining data in a table Sep 20, 2018
sessions and requests.sql minor comments for retaining data in a table Sep 20, 2018
sessions sql2000.sql initial Jul 20, 2017
sharepoint databases.ps1 initial checkin Dec 21, 2017
size database files.sql rename for proper git sorting Nov 10, 2017
size in memory.sql initial Jul 20, 2017
size.sql
sp_GetAGInformation.sql initial Jul 20, 2017
sp_repldone.sql add Jul 13, 2018
space in files.sql updated to order by % free space available Jul 11, 2018
sproc sessions and requests.sql
ssis events.sql initial Jul 20, 2017
ssisdb execution query.sql
ssisdb package history.sql add ssis package version history Aug 2, 2018
ssrs Subscription catalog inventory.sql rename for proper git sorting Nov 10, 2017
ssrs Subscription failure emails.sql make generic Jul 30, 2018
ssrs Subscription start jobs.sql rename for proper git sorting Nov 10, 2017
stats out of date whileloop.sql minor edits Jan 2, 2018
stats out of date.sql minor edits Jan 2, 2018
sys.dm_io_virtual_file_stats.sql initial Jul 20, 2017
sys_dm_os_ring_buffers.sql new diagnostic sample script Oct 9, 2017
tables without clustered indexes.sql initial Jul 20, 2017
tempdb data files.sql
test user permissions.sql initial Jul 20, 2017
toolbox-stablestate.zip latest files Sep 20, 2018
toolbox.zip latest files Sep 20, 2018
uncommitted transactions.sql initial add Jul 9, 2018
vlfs analysis.sql mark a todo for new DMV Sep 6, 2018
volume stats.sql
worst queries.sql
xevent ringbuffer.sql initial Jul 20, 2017
zip toolbox.ps1 including sessions and requests in .zip Sep 10, 2018

README.md

sql-server-toolbox

SQL Server Toolbox

Getting Started

A loose assembly of files use for day-to-day administration, performance tuning, troubleshooting and investigation of Microsoft SQL Server databases.

Prerequisites

Many scripts have alternative versions for backwards compatibility with SQL Servers prior to SQL Server 2012, most scripts developed for SQL Server 2012 or higher, many with comments indicating features added in specific versions of SQL Server. Execution intended with SSMS/VSCode without SQLCMD mode enabled for most scripts.

Contributing

Suggestions/corrections welcome. Collaboration limited to internal SQLDBA team.

Authors

Acknowledgments

  • Code snippet source documented with URL where appropriate, if lacking, please notify us.

Easy Download