Clone or download
Latest commit b440c2c Jan 10, 2019
Permalink
Type Name Latest commit message Commit time
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 updated for correct time zoning, workaround for MS bug in Xevent time… Nov 30, 2018
AG - Monitor.sql enhanced log_send metric reporting Dec 16, 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 cleanup and standardize naming for AG scripts Sep 10, 2018
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 - monitor automatic seeding.sql initial add Oct 11, 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.md Jan 3, 2019
Sharepoint Recovery Models.sql Rename Sharepoint Recovery Models to Sharepoint Recovery Models.sql Dec 19, 2017
add database descriptions.sql initial Jul 20, 2017
add error event alerts.sql fix typo Oct 5, 2017
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 commenting improvements Dec 14, 2018
avg disk secwrite.png initial Jul 20, 2017
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 Update backup history oldest latest.sql Feb 2, 2018
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 initial Jul 20, 2017
cpu utilization.sql redirect to a more sophisticated view of the same cpu data Sep 5, 2018
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 better comments Dec 14, 2018
deadlocks in xevents.sql replace/rewrite Oct 3, 2017
defrag columnstore.sql update comments, add size Oct 11, 2018
defrag.sql latest comments, removed filters by default Nov 29, 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 initial Jul 20, 2017
dm_exec_session_wait_stats.sql initial Jul 20, 2017
dm_os_performance_counters.sql add Sep 5, 2018
dm_os_wait_stats.sql sync Aug 30, 2017
dm_os_waiting_tasks.sql initial Jul 20, 2017
easy passwords.sql performance improvements, more comments and TODO's Oct 24, 2018
endpoint owners.sql initial Jul 20, 2017
error log.sql minor change to default date filter May 8, 2018
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 initial Jul 20, 2017
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
hypothetical cleanup.sql add hypothetical object cleanup script Sep 27, 2018
index ALLOW_PAGE_LOCKS.sql rename for proper git sorting Nov 10, 2017
index_usage_stats.sql initial Jul 20, 2017
indirect checkpoints enable.sql initial checkin Nov 20, 2017
install failover clustering features.ps1 initial Sep 11, 2017
instant_file_initialization.sql update comments for versions supported Oct 15, 2018
job - Space in Files Monitoring.sql add to toolbox Oct 24, 2018
job - Volume Stats Monitoring.sql minor updates to object names Oct 24, 2018
job - job failure notifications.sql standardize these scripts to be more like job owners, db owners, etc Nov 28, 2018
job - memory stats Monitoring.sql rename volume stat mon job, add memory mon job Feb 6, 2018
job - setup database audit.sql setup database audit job script Aug 10, 2018
job failure notifications.sql standardize these scripts to be more like job owners, db owners, etc Nov 28, 2018
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 rename/organize Nov 9, 2017
lab - VLF generation example.sql rename/organize Nov 9, 2017
lab - azure blob storage retention plan.ps1 add lab for powershell retention Feb 2, 2018
lab - backup to URL.sql rename/organize Nov 9, 2017
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 rename/organize Nov 9, 2017
lab - deadlock part 2.sql rename/organize Nov 9, 2017
lab - dynamic data masking.sql rename/organize Nov 9, 2017
lab - filetable demo.sql rename/organize Nov 9, 2017
lab - fragmented table int.sql update for dmv preso Sep 5, 2018
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 - materialized view with columnstore.sql Update lab - materialized view with columnstore.sql Oct 15, 2018
lab - missing index setup demo.sql rename/organize Nov 9, 2017
lab - power of columnstore.sql rename/organize Nov 9, 2017
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 cleanup Nov 28, 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 rename for proper git sorting Nov 10, 2017
log_reuse_wait.sql initial add Jul 9, 2018
memory-optimized table memory usage.sql initial Feb 14, 2018
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 initial Jul 20, 2017
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 initial Jul 20, 2017
optimize for ad hoc workloads.sql initial Jul 20, 2017
overdue jobs.sql comments only Sep 10, 2018
page life expectancy.sql update comments for versions supported Oct 15, 2018
public permissions.sql Update public permissions.sql Mar 6, 2018
rebuild SSRS RSExecRole permissions.sql sync Aug 30, 2017
record_dm_io_virtual_file_stats.sql initial Jul 20, 2017
refresh view metadata.sql initial Jul 20, 2017
rename SQL instance.sql rename for proper git sorting Nov 10, 2017
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 fixed the way tempdb alloc is reported Oct 1, 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 initial Jul 20, 2017
sp_GetAGInformation.sql initial Jul 20, 2017
sp_repldone.sql add Jul 13, 2018
space in files.sql add file type to make it more obvious Dec 16, 2018
sproc sessions and requests.sql initial Jul 20, 2017
ssis events.sql initial Jul 20, 2017
ssisdb execution query.sql initial Jul 20, 2017
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 update stats out of date whileloop comments Jan 3, 2019
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 add vol info to tempdb query Jan 3, 2019
test user permissions.sql initial Jul 20, 2017
toolbox zip add vol info to tempdb query Jan 3, 2019
toolbox-stablestate.zip latest autozips Jan 10, 2019
toolbox.zip latest autozips Jan 10, 2019
uncommitted transactions.sql initial add Jul 9, 2018
vlfs analysis.sql additional comments, cleanup Dec 15, 2018
volume stats.sql Added Volume Name Nov 20, 2018
worker threads diagnostic.sql update comments Dec 17, 2018
worst queries.sql add sqltext to build freeproccache, find proc name in comments block Sep 10, 2018
xevent ringbuffer.sql initial Jul 20, 2017
zip toolbox.ps1 Update zip toolbox.ps1 Jan 8, 2019

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, unless otherwise noted.

PowerShell should be supported for PowerShell 3+ unless otherwise noted.

Contributing

Suggestions/corrections welcome. Collaboration limited to Sparkhound SQL DBA team.

Contributors

Acknowledgments

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

Easy Download