Click here to monitor SSC
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 3332    Older >>
 

Find Missing Backups and send the report

This script is used to Find missing backups on an instance and send the report via email.   Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 20 reads

Get earliest and latest date values in a database

Query the earliest and latest date values found in all datetime columns in the current database.  Read more...
By Steve Armistead 2016/06/21 | Source: SQLServerCentral.com | Category: database aging
Rating: (not yet rated) |  Discuss |   Briefcase | 45 reads

Find Free Space by Database

This is one of the handy script to find the free space by each database. This is useful when you troubleshoot the database space issues.   Read more...
Rating: |  Discuss |   Briefcase | 37 reads

Get Blocking Details

Use this script to get blocking details in SQL Server.  Read more...
By Rahul Biswas 2016/06/15 | Source: SQLServerCentral.com | Category: blocking details
Rating: |  Discuss |   Briefcase | 104 reads

Database Snapshot Creat/Drop/Restore SQL Script.

Database Snapshot Creat/Drop/Restore SQL Script for Single or multiple data files of databases.  Read more...
Rating: |  Discuss |   Briefcase | 64 reads

Kill Connections for a specific database

This script will kill all connections for a database.  Read more...
By Rahul Biswas 2016/06/15 | Source: SQLServerCentral.com | Category: kill connections
Rating: |  Discuss |   Briefcase | 69 reads

Quick table size information

Uses a loop and sp_spaceused to populate a temp table with size info  Read more...
By Gabe Tower 2016/06/08 | Source: SQLServerCentral.com | Category: table size
Rating: |  Discuss |   Briefcase | 76 reads

Script to Generate Foreign Keys

Generate Script for existing Foreign Keys for any emergency.  Read more...
By Sheraz Mirza 2016/05/26 | Source: SQLServerCentral.com | Category: foreign keys (fk)
Rating: |  Discuss |   Briefcase | 47 reads

Procedure to Find Candidate Keys

This Procedure will Display all the keys in a Specified Table   Read more...
Rating: |  Discuss |   Briefcase | 84 reads

Job Step Log Output file path

If you have a requirement to carefully have the output file against each sql agent job step, you can use this script. If incase, there are many sql agent jobs and by any reason if any of the step does not have proper o/p file, this script can automatically create the o/p file.  Read more...
By S M 2016/05/20 | Source: SQLServerCentral.com | Category: agent jobs
Rating: |  Discuss |   Briefcase | 72 reads

Getting LEAD and LAG values manually

LEAD and LAG functions are new in SQL Server 2012 , This short Script could be used to get these values in Earlier versions also  Read more...
By Sheraz Mirza 2016/06/28 | Source: SQLServerCentral.com | Category: lead function in 2008
Rating: |  Discuss |   Briefcase | 450 reads

Index and Column Configuration

Returns the indexes in a database along with all of the columns in the index in a consolidated format  Read more...
By Tennery Press 2016/06/29 | Source: SQLServerCentral.com | Category: index
Rating: (not yet rated) |  Discuss |   Briefcase | 371 reads

DigitsOnlyEE and AlphaNumericOnly

A nasty fast way to remove non-numeric and non-alphanumeric characters from a string  Read more...
By Alan Burstein 2016/06/23 | Source: SQLServerCentral.com | Category: string function
Rating: |  Discuss |   Briefcase | 341 reads

Send Email to recipients with Attachment using PowerShell

If you have a requirement to send email to recipients with attachment, can use the script.  Read more...
Rating: |  Discuss |   Briefcase | 413 reads

New T-SQL Fixed Width "Splitter"

A brand new tally table based, fixed width "splitter" that can be used for much more than just string splitting  Read more...
By Alan Burstein 2016/06/22 | Source: SQLServerCentral.com | Category: set-based
Rating: |  Discuss |   Briefcase | 621 reads

Translate function for SQL Server

Relational database management systems such as Oracle, Postgres, DB2 and Teradata, as well as other programming languages such as Python, Hive, XSLT and SAS have a Translate function. Now we have one for SQL Server.  Read more...
By Alan Burstein 2016/06/01 | Source: SQLServerCentral.com | Category: string function
Rating: |  Discuss |   Briefcase | 623 reads

Export table to file with bcp chunk

Export table to file with bcp chunk  Read more...
By Dmitriy Ivanov 2016/06/02 | Source: SQLServerCentral.com | Category: bcp
Rating: |  Discuss |   Briefcase | 487 reads

Replication-Quick way to determine the articles

Replication related script- quick way to determine the publication name, Article and column which are part of the different publications.  Read more...
By Koushik Roy 2016/06/06 | Source: SQLServerCentral.com | Category: replication
Rating: (not yet rated) |  Discuss |   Briefcase | 289 reads

Table Comparison Procedure

Procedure to compare two tables , getting table names and rows to display  Read more...
By Sheraz Mirza 2016/06/07 | Source: SQLServerCentral.com | Category: table data comparison
Rating: |  Discuss |   Briefcase | 687 reads

List instances hosting similarly named databases

Lists instances, aliased linked servers, and databases pattern matched on the linked server and database names  Read more...
By John Rogerson 2016/06/03 | Source: SQLServerCentral.com | Category: linked server
Rating: |  Discuss |   Briefcase | 253 reads
   Items 1 to 20 of 3332    Older >>