Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rudi-bruchez/tsql-scripts

Transact-SQL scripts and gists
https://github.com/rudi-bruchez/tsql-scripts

database-administration mssql sql-server sqlserver t-sql tsql

Last synced: 7 days ago
JSON representation

Transact-SQL scripts and gists

Awesome Lists containing this project

README

        

# ☯ tsql-scripts

Transact-SQL scripts and gists for administration and [diagnostics](./diagnostics/).

You'll also find some [management stored procedures](./stored-procedures/)

Feel free to use them and copy them. If you have significant improvements to propose, please fork the repo and propose a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests).

## Folders

You'll find here the following folders :

- [Azure](./azure/) — queries for [Azure SQL Database](./azure/azure-sql-database/) and Azure Managed Instances administration and diagnostics. Those queries use specific Azure views and metadata. Some Extended events for Azure SQL Database can also be found in [extended-events/azure-sql-database](./extended-events/azure-sql-database/).
- [database-administration](./database-administration/) — queries for [database maintenance](./database-administration/maintenance/), [DDL generation](./database-administration/ddl-generation/), informations about [security principals and privileges](./database-administration/security/), [SQL Server Agent](./database-administration/sqlagent/), [alerts](./database-administration/alerts/) and code to [create the `_dba` database](./database-administration/dba-database/) I use for some customers.
- [database-information](./database-information/) — metadata about databases : [size](./database-information/size-and-allocation/), [compression](./database-information/compression/), [transaction log](./database-information/transaction-log/), etc.
- [diagnostics](./diagnostics/) — diagnostics queries.
- [execution](./diagnostics/execution/) — diagnostics queries to inspect running queries, procedures and active transactions.
- [execution-stats](./diagnostics/execution-stats/) — statistics about query performances.
- [IO](./diagnostics/IO/) — information about physical IO.
- [locking](./diagnostics/locking/) — locking and blocking.
- [memory](./diagnostics/Memory/) — memory usage : buffer pool and plan cache.
- [query-store](./diagnostics/query-store/) — Query Store management.
- [sessions](./diagnostics/sessions/) — opened sessions.
- [tempdb](./diagnostics/tempdb/) — tempdb diagnostics queries, including version store.
- [wait_statistics](./diagnostics/wait-statistics/) — Wait statistics.
- [extended-events](./extended-events/) — code to create extended events [on-prem](extended-events/on-prem/) and on [Azure SQL Database](extended-events/azure-sql-database/). You'll also find queries to read the content of the targets.
- [hadr](./hadr/) — queries for AlwaysOn Failover Clustering and AlwaysOn Availability Groups.
- [index-management](./index-management/) — missing indexes, index usage, fragmentation analysis, etc.
- [monitoring](./monitoring/) — queries to monitor current operations, like backups, shrink or DBCC execution.
- [powershell](./powershell/) — Powershell scripts for administration.
- [replication](./replication/) — Replication related queries.
- [server-information](./server-information/) — queries to get server / instance information.
- [service-broker](./service-broker/) — Service Broker related queries
- [stored-procedures](./stored-procedures/) — Stored procedure for quick info in your database, like getting active transactions, database information, memory status or [sp_logspace](./stored-procedures/sp_logspace.sql), a replacement for `DBCC SQLPERF (LOGSPACE)`.