Scripts

Technical Article

Resize data file manually to prevent downtime

This script will resize the data file of a passed in database name and filename by 10%. It can run in 3 modes.Resize, INFO, HELP. RESIZE is passed into parameter @Mode when we know the database name and file we wish to resize. INFO is passed in when we only know the database name and […]

You rated this post out of 5. Change rating

2003-06-19

670 reads

Technical Article

Height Format Function

This function takes a decimal representation of a height value and returns a properly formatted string value.                     For example, a height of 5 feet 9 inches, which would be passed in as the decimal 5.90, would be returned as 5'9".                     Similarly, a height of 4 […]

You rated this post out of 5. Change rating

2003-06-18

1,753 reads

Technical Article

SPLIT function

This is a port of the SPLIT function from Perl (or VBScript). It works the same way: pass a string anda separator, up to 4 characters long (you can change this),and the function returns a table with the elements.This version trims leading and trailling spaces of the elements, just for convenience.Example:SELECT    strvalFROM    master.dbo.SPLIT('a and b', […]

(1)

You rated this post out of 5. Change rating

2003-06-13

238 reads

Technical Article

Search all objects in all DBs for code fragments

This procedure allows you to search through all objects in all databases on your server for words/phrases in your object code.  Very handy for cases in which, for example, a column name on a table has been changed and you need to search your entire server for any sprocs/views/etc. that might reference it.Syntax: [EXEC] sp_FindCodeStr […]

You rated this post out of 5. Change rating

2003-06-10

278 reads

Technical Article

detect different datatypes

-  a simple and handy script that finds what differences might exists between the fields in your database that have the same name.I was wondering why my execution plans where different  for tables with the same  field names and the same indexes,statistics etc... because the syetem was converting my fields in the WHERE statement. -  […]

You rated this post out of 5. Change rating

2003-06-08

121 reads

Blogs

From DBA or Data Engineer to AI Engineer: A Realistic Path

By

If you spend your days tuning queries, managing pipelines, or keeping a production database...

Asynchronous Replication of Snapshots from an ActiveCluster Pod to a Third Array

By

I’ve been rebuilding my three-site SQL Server demo lab, and I ran into something...

SQL Server gMSA: Why So Many DBAs Still Aren't Using It in 2026

By

SQL Server gMSA: Why DBAs Still Aren't Using It in 2026 ...

Read the latest Blogs

Forums

Never is Not the Policy

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Never is Not the Policy

Automating SSAS Multidimensional Security Audits with PowerShell

By Pablo Echeverria

Comments posted to this topic are about the item Automating SSAS Multidimensional Security Audits...

Rebuilding All Indexes

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Rebuilding All Indexes

Visit the forum

Question of the Day

Rebuilding All Indexes

I have added a few indexes to one of my tables in SQL Server 2025:

ALTER TABLE dbo.CustomerContact
ADD CONSTRAINT PK_CustomerContact
    PRIMARY KEY (CustomerID);

-- Create index on CustomerEmail
CREATE INDEX IX_CustomerContact_CustomerEmail
ON dbo.CustomerContact (CustomerEmail);
CREATE INDEX IX_CustomerContact_CustomerEmail
ON dbo.CustomerContact (phone);
I then do this to disable one index:
alter index IX_CustomerContact_CustomerPhone on dbo.CustomerContact disable
I see this when I check the index status:Index status for CustomerContactI decide to rebuild all indexes with this command:
ALTER INDEX ALL ON dbo.CustomerContact
After I do this, what will I see for the index status?

See possible answers