This script combines functionality of sp_helpindex and sp_spaceused to list all tables with individual indexes, their keys and description (sp_spaceused cannot do that) and size in MB per individual index (sp_helpindex cannot do that either). Feel free to use and modify as you see fit. Hope it can help.
2007-07-03 (first published: 2006-09-25)
2,634 reads
Stored procedure to return the list of columns of the primary key for a table. The name of the column for the result set is the name of the primary key for the table.
2006-09-14 (first published: 2006-09-07)
667 reads
This function returns the SQL Build Number as an int. i.e. 7, 8, or 9. @@Version is great, but super long, and the formatting of the string has changed over the years. This helps me find out what version of SQL I'm working on in a quick and efficient manner. The script includes the drop […]
2006-08-08 (first published: 2006-06-23)
1,212 reads
This function returns the SQL Build Number as a nvarchar(20) string. i.e. '8.00.760' @@Version is great, but super long, and the formatting of the string has changed over the years. This helps me find out what build of SQL I'm working on in a quick and efficient manner. The script includes the drop statement as […]
2006-08-09 (first published: 2006-06-23)
984 reads
this script will generate CREATE index statements for all indexes in the database;there are already scripts out there that script constraints for primary keys and unique constraints, which automatically create an index behind the scenes. but what about the other indexes?uncomment two statements in order to filter out primary keys and Unique indexes so you […]
2006-03-17 (first published: 2006-03-07)
25,876 reads
This is an improved and expanded version of the previously posted script that moves indexes to a new file group. This version will:1. Create new filegrup and files for indexes2. Script out and recreate indexes on new drive3. NEW* output report to text file4. NEW* Will run with enclosed wrapper for ALL DATABASES ON THE […]
2006-03-22 (first published: 2006-03-02)
1,998 reads
2006-02-15 (first published: 2006-02-13)
1,410 reads
This SQL script returns a recordset with all the index information for all tables for all databases in a SQL server(instance)
2006-10-30 (first published: 2005-10-07)
2,479 reads
This SQL script returns a recordset with all the index information for all tables within a database
2005-10-18 (first published: 2005-10-07)
852 reads