https://github.com/onebeyond/sql-utils
https://github.com/onebeyond/sql-utils
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/onebeyond/sql-utils
- Owner: onebeyond
- License: mit
- Created: 2025-01-15T11:59:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-12T14:25:46.000Z (about 1 year ago)
- Last Synced: 2025-06-12T15:36:07.436Z (about 1 year ago)
- Language: TSQL
- Size: 3.91 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SQL Utils
This repository is for containing any useful SQL Snippets for use in day-to-day programming. These should be largely generic in nature (ie: not project/codebase specific). Please document what each snippet does in this readme as well as any limitations (what SQL versions/libraries it's for).
### TableSize.sql
This lists all DB Tables in a database by size. Helpful for figuring out if there's any weird growth in a DB table, or if indexing might be required, without having to execute `SELECT COUNT(*)` which uses significant DB processing time .
- SQLServer specific.
### FirstRowOfEachTable.sql
This script lists the first row of each table with a column called "Id", where the data type is an "int"
and the value of that Id is 0. While that's quite specific, it gives an example on how to filter
table lists by values in their columns etc - so can be adapted to use nvarchar etc, change column
names etc. Useful for diagnosing strange cross-table problems.
- SQLServer specific.