SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Add a script

   Items 1 to 20 of 3530    Older >>


modernized sp_helpindex with info on post S2K features 
By Joe Chang 2018/10/19 | Source: SQLServerCentral.com | Category: indexing
Rating: (not yet rated) |  Discuss |   Briefcase | 2 reads


extensions to sp_spaceused 
By Joe Chang 2018/10/15 | Source: SQLServerCentral.com
Rating: (not yet rated) |  Discuss |   Briefcase | 7 reads

Mechanism To Dynamically Build Pivot Table

Script to build PIVOT queries with an arbitrary number of columns  Read more...
By Gaby Abed 2018/10/15 | Source: SQLServerCentral.com | Category: pivot table
Rating: (not yet rated) |  Discuss |   Briefcase | 6 reads

View Server Roles and Permissions per Login

obtain server roles and permissions by login 
By Perry Whittle 2018/10/12 | Source: SQLServerCentral.com | Category: server roles
Rating: |  Discuss |   Briefcase | 267 reads

How to Identify backup tables within production databases

How to identify backup tables within production databases that can be removed.   Read more...
Rating: |  Discuss |   Briefcase | 205 reads

Detect and Repair Non Trusted Foreign Keys

Create the code to detect and repair non trusted foreign keys  Read more...
By Ronald Hensbergen 2018/09/27 | Source: SQLServerCentral.com | Category: foreign keys
Rating: (not yet rated) |  Discuss |   Briefcase | 1 read

Purging table script

Script to purge big tables in small batches of 500  Read more...
By Abhishek Dwivedi 2018/09/26 | Source: SQLServerCentral.com | Category: purgingtable
Rating: (not yet rated) |  Discuss |   Briefcase | 58 reads

Conditionally Order By Different Column

Order records based on a different column depending on which absolute value is greater.  Read more...
By Noel Scheaffer 2018/10/01 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 354 reads

Data Collections restart and clear cache files

Script to stop the default Data Collection sets, clear the cache files and then restart collection sets.  Read more...
By Matt Frend 2018/10/02 | Source: SQLServerCentral.com | Category: data collections
Rating: (not yet rated) |  Discuss |   Briefcase | 128 reads

number of rows and columns of an instance

Get the number of rows, columns, and space used by all tables in all databases  Read more...
By Fabiano Carvalho 2018/10/03 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 211 reads

T-SQL to compress (shorten) IPv6 address

Didn't find anything, so hope this will help someone with similar need. Note I did a similar set-based version, and unless the input is more towards non-zeros in all eight 2-byte fields, the set-based performs not as well  Read more...
By jianqing_ye 2018/09/19 | Source: SQLServerCentral.com | Category: t-sql
Rating: (not yet rated) |  Discuss |   Briefcase | 184 reads


A copy of the late Robert Davis' dba_copylogins stored procedure with a bug fix. The SP copies logins, roles, and permissions between servers.  Read more...
By Chuck Hamilton 2018/09/24 | Source: SQLServerCentral.com | Category: copy logins
Rating: |  Discuss |   Briefcase | 267 reads

Compare Table Contents Procedure

Compare the content of two tables for differences  
By Damir Sprecic 2018/09/20 | Source: SQLServerCentral.com | Category: compare
Rating: |  Discuss |   Briefcase | 312 reads


Sp to Generate Restore sequence 
By Harkamal Singh 2018/09/04 | Source: SQLServerCentral.com | Category: backup and restore
Rating: |  Discuss |   Briefcase | 194 reads


This scripts helps to generate ADD / DROP Constraints against single Database.  Read more...
By Aswini G 2018/09/03 | Source: SQLServerCentral.com | Category: table constraints
Rating: |  Discuss |   Briefcase | 157 reads

Table Space Used in DB

A quick script that provides the sizes of the tables in your database, including schema and choice of sort method  Read more...
By Luis Chiriff 2018/08/07 | Source: SQLServerCentral.com | Category: sp_spaceused
Rating: |  Discuss |   Briefcase | 437 reads

SQL table to HTML

Convert any table or select query to a html table format  Read more...
By Eduardo Pivaral 2018/08/09 | Source: SQLServerCentral.com | Category: tsql
Rating: |  Discuss |   Briefcase | 591 reads


Another way to do a "Multi"- replace 
By Jonny Wallman 2018/08/13 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 411 reads

STRING and FIND SQL Functions

SQL Functions that simplify search and operations over strings on SQL Server (starting with 2012)  Read more...
By Pedro Costa 2018/07/11 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 601 reads
   Items 1 to 20 of 3530    Older >>