Display the SELECT statement for any table
Found this lovely T-SQL script to display the SELECT statement for any table.
2013-08-22 (first published: 2013-08-06)
3,244 reads
Found this lovely T-SQL script to display the SELECT statement for any table.
2013-08-22 (first published: 2013-08-06)
3,244 reads
This script shows size information of every database on the instance.
2013-08-21 (first published: 2010-07-26)
5,958 reads
Create views based on table definitions for backwards compatibility when relocating tables to a new database.
2013-08-16 (first published: 2013-07-30)
1,121 reads
Transact-SQL does not have a simple method to launch multiple parallel running scripts. This tool will change the game. It requires SQL Server 2005 or above.
2013-08-13 (first published: 2009-08-28)
17,535 reads
Use this script to find the Stored Procedures which are referencing the table passed as argument from all databases on the server.
2013-08-12 (first published: 2013-08-02)
1,139 reads
Dynamically drop a user from each database on an SQL instance by their server login SID, then remove there server login as well. Plus some helpful printable information when ran.
2013-08-09 (first published: 2013-07-16)
918 reads
Easiest way to search for a string in any object within the database.
2013-08-08 (first published: 2013-07-29)
2,316 reads
A simple T-SQL script to display the number of days since the last database backup.
2013-08-07 (first published: 2013-07-29)
1,664 reads
2013-07-31 (first published: 2008-07-15)
1,622 reads
2013-07-30 (first published: 2013-06-12)
1,534 reads
By Steve Jones
I recently started playing with the MCP Server for SQL Server, which is a...
If you spend your days tuning queries, managing pipelines, or keeping a production database...
I’ve been rebuilding my three-site SQL Server demo lab, and I ran into something...
Has anyone written a wrapper function (or similar) around STRING_AGG() to allow the retrieval...
Putting this here as we're currently on SQL Server 2019 installed on Windows Server...
Comments posted to this topic are about the item Never is Not the Policy
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_CustomerPhone
ON dbo.CustomerContact (phone);
I then do this to disable one index:
alter index IX_CustomerContact_CustomerPhone on dbo.CustomerContact disableI see this when I check the index status:
I decide to rebuild all indexes with this command:
ALTER INDEX ALL ON dbo.CustomerContact rebuildAfter I do this, what will I see for the index status? See possible answers