{"id":21684257,"url":"https://github.com/rudi-bruchez/tsql-scripts","last_synced_at":"2025-07-15T20:45:43.386Z","repository":{"id":55062446,"uuid":"135034759","full_name":"rudi-bruchez/tsql-scripts","owner":"rudi-bruchez","description":"Transact-SQL scripts and gists","archived":false,"fork":false,"pushed_at":"2025-03-20T12:48:35.000Z","size":382,"stargazers_count":55,"open_issues_count":0,"forks_count":13,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-02T22:06:34.577Z","etag":null,"topics":["database-administration","mssql","sql-server","sqlserver","t-sql","tsql"],"latest_commit_sha":null,"homepage":null,"language":"TSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rudi-bruchez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-27T10:02:35.000Z","updated_at":"2025-03-28T19:02:11.000Z","dependencies_parsed_at":"2024-10-21T18:52:31.098Z","dependency_job_id":null,"html_url":"https://github.com/rudi-bruchez/tsql-scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudi-bruchez%2Ftsql-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudi-bruchez%2Ftsql-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudi-bruchez%2Ftsql-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudi-bruchez%2Ftsql-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rudi-bruchez","download_url":"https://codeload.github.com/rudi-bruchez/tsql-scripts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131483,"owners_count":21052854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database-administration","mssql","sql-server","sqlserver","t-sql","tsql"],"created_at":"2024-11-25T16:15:05.335Z","updated_at":"2025-04-10T00:19:17.922Z","avatar_url":"https://github.com/rudi-bruchez.png","language":"TSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ☯ tsql-scripts\n\nTransact-SQL scripts and gists for administration and [diagnostics](./diagnostics/).\n\nYou'll also find some [management stored procedures](./stored-procedures/)\n\nFeel 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).\n\n## Folders\n\nYou'll find here the following folders :\n\n- [Azure](./azure/) \u0026mdash; 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/).\n- [database-administration](./database-administration/) \u0026mdash; 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.\n- [database-information](./database-information/) \u0026mdash; metadata about databases : [size](./database-information/size-and-allocation/), [compression](./database-information/compression/), [transaction log](./database-information/transaction-log/), etc.\n- [diagnostics](./diagnostics/) \u0026mdash; diagnostics queries.\n  - [execution](./diagnostics/execution/) \u0026mdash; diagnostics queries to inspect running queries, procedures and active transactions.\n  - [execution-stats](./diagnostics/execution-stats/) \u0026mdash; statistics about query performances.\n  - [IO](./diagnostics/IO/) \u0026mdash; information about physical IO.\n  - [locking](./diagnostics/locking/) \u0026mdash; locking and blocking.\n  - [memory](./diagnostics/Memory/) \u0026mdash; memory usage : buffer pool and plan cache.\n  - [query-store](./diagnostics/query-store/) \u0026mdash; Query Store management.\n  - [sessions](./diagnostics/sessions/) \u0026mdash; opened sessions.\n  - [tempdb](./diagnostics/tempdb/) \u0026mdash; tempdb diagnostics queries, including version store.\n  - [wait_statistics](./diagnostics/wait-statistics/) \u0026mdash; Wait statistics.\n- [extended-events](./extended-events/) \u0026mdash; 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.\n- [hadr](./hadr/) \u0026mdash; queries for AlwaysOn Failover Clustering and AlwaysOn Availability Groups.\n- [index-management](./index-management/) \u0026mdash; missing indexes, index usage, fragmentation analysis, etc.\n- [monitoring](./monitoring/) \u0026mdash; queries to monitor current operations, like backups, shrink or DBCC execution.\n- [powershell](./powershell/) \u0026mdash; Powershell scripts for administration.\n- [replication](./replication/) \u0026mdash; Replication related queries.\n- [server-information](./server-information/) \u0026mdash; queries to get server / instance information.\n- [service-broker](./service-broker/) \u0026mdash; Service Broker related queries\n- [stored-procedures](./stored-procedures/) \u0026mdash; 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)`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudi-bruchez%2Ftsql-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frudi-bruchez%2Ftsql-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudi-bruchez%2Ftsql-scripts/lists"}