This repository contains a collection of SQL scripts that I've collected over the years. Some of them are mine, some of them might be yours, if your recognise something please let me know so I can give you credit :)
This project is licensed under the terms of the MIT license.
If you find these useful then I'm glad but I'm not a DBA so use at your own risk.
Generic database scripts for admin, analysis and audit tasks.
- drop all objects in a database.
- rebuild indexes.
- revoke all permissions.
- grant permissions.
- disable / enable triggers.
- discover space used for tables, indexes, database files.
- generate a checksum that can be used to compare one database to another (a bit low-tech..)
A series of functions to provide various functionally.
- convert DateTime to Ticks.
- convert Ticks to DateTime.
- parse string to table.
Random scripts.
- create a Deadlock to test a system's ability to cope with this error.
Snippets for SQL Prompt.