Indexing

Technical Article

List all indexes with keys, description and size

  • Script

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.

5 (9)

You rated this post out of 5. Change rating

2007-07-03 (first published: )

2,634 reads

Technical Article

Function to return the SQL Version Number

  • Script

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 […]

You rated this post out of 5. Change rating

2006-08-08 (first published: )

1,212 reads

Technical Article

Function to return the SQL Build Number

  • Script

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 […]

5 (1)

You rated this post out of 5. Change rating

2006-08-09 (first published: )

984 reads

Technical Article

Script all indexes as CREATE INDEX statements

  • Script

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 […]

4.22 (18)

You rated this post out of 5. Change rating

2006-03-17 (first published: )

25,876 reads

Technical Article

Improved Move indexes to new file group

  • Script

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 […]

4.33 (3)

You rated this post out of 5. Change rating

2006-03-22 (first published: )

1,998 reads

Blogs

SQL Saturday Boston 2024 Slides

By

Thanks to everyone that came to my talks. Slides are below. Best Practices for...

Small Data SF 2024

By

I can’t remember how I heard about Small Data SF 2024, but it caught...

A New Word: Moledro

By

moledro – n. a feeling of resonant connection with an author or artist you’ll...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers