Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
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 3240    Older >>

SQL Jobs on Always On

This script will check the status of the node in Always On and enable or disable the jobs according to our requirement.  Read more...
By Raghavender Chavva 2015/11/18 | Source:
Rating: (not yet rated) |  Discuss |   Briefcase | 83 reads

proc to calculate DM_OS_PERFORMANCE_COUNTERS over time interval

This is a stored proc that gives you the calculated performance counters over a time interval you specify.  Read more...
By John Heimiller 2015/11/13 | Source: | Category: performance
Rating: (not yet rated) |  Discuss |   Briefcase | 48 reads

View for Ola Hallengren CommandLog

Add 3 columns, duration in seconds,Pagecount and fragmentation. For people like me who don't enjoy querying XML.  Read more...
By Doran Mackay 2015/11/12 | Source:
Rating: |  Discuss |   Briefcase | 107 reads

AlwaysOn Replica Failover Status Check

Template script/stored proc for sending notification and performing post failover tasks  Read more...
By Stan Lin 2015/11/09 | Source: | Category: alwayson
Rating: |  Discuss |   Briefcase | 105 reads

Extarcting string after and before a Character/Pattern

Finding characters/string before and after some character or pattern  Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 100 reads

HashBytes Nvarchar(MAX)

SQL SERVER Includes a Hashbytes function, however it's limited to VARCHAR(8000). This can cause a problem when trying to build hashes over wide datasets. Solution Expose the C# Hashbytes function using CLR  Read more...
By Simon Hundleby 2015/11/06 | Source: | Category: clr
Rating: (not yet rated) |  Discuss |   Briefcase | 57 reads

Design Errors : PK's with multiple columns on table with identity

Find Tables with identity, which should have PK with 1 column but have a PK which is clustered but has multiple columns.  Read more...
By Doran Mackay 2015/11/24 | Source: | Category: database design
Rating: |  Discuss |   Briefcase | 687 reads

Database Backup Information Scripts

Scripts used to validate the backups information as below 1) Database Backups for all databases For Previous Week 2) Most Recent Database Backup for Each Database 3) Most Recent Database Backup for Each Database - Detailed 4) Databases Missing a Back-Up Within Past 24 Hours  Read more...
By Sathya Praveen 2015/11/25 | Source: | Category: database
Rating: |  Discuss |   Briefcase | 518 reads

List file name, size of all databases

lists file name, size of all databases in sql server  Read more...
By Michael Zhang 2015/11/02 | Source: | Category: db name
Rating: |  Discuss |   Briefcase | 209 reads

Constraints renaming

Rename constraints to enforce naming conventions. 
By Luis Cazares 2015/11/18 | Source: | Category: constraints
Rating: |  Discuss |   Briefcase | 558 reads

Disk Space Alerts Based on Threshold Value

This script will drop a mail for sql drives if space on drives is below set threshold value. Log drives with 15 and data files drives with value of 10% as threshold value of free space.  Read more...
By Ajay Dwivedi 2015/11/19 | Source: | Category: space
Rating: (not yet rated) |  Discuss |   Briefcase | 958 reads

Figure out recovery mode for each database

It is anoying that someone created a new database and left its recovery mode in simple and it caused your backup jobs to fail.  Read more...
By Michael Zhang 2015/11/23 | Source: | Category: database
Rating: |  Discuss |   Briefcase | 390 reads

Temporary exclusive database access

This simple script disconnects any other session that is connected to the specified database by temporarily switching the database to single user.  Read more...
By Tom Staab 2015/11/20 | Source: | Category: administration
Rating: |  Discuss |   Briefcase | 693 reads

Read SQL Error logs

Query to read error logs from current/archive files  
Rating: |  Discuss |   Briefcase | 1,350 reads

List Expressions and Values of Variables in SSIS package

Variables can be direct text or Expressions. It's handy to be able to get both at one pass. This little script does that.  Read more...
By Wayne Findley 2015/11/17 | Source: | Category: variables
Rating: (not yet rated) |  Discuss |   Briefcase | 762 reads

Mirroring Automation

Automating the Mirroring configuration for new databases 
By Vasan Balu 2015/11/16 | Source: | Category: mirroring
Rating: |  Discuss |   Briefcase | 876 reads

Who are connecting to database and disconnect ...

When you want gain exclusive access to database in order to restore database  Read more...
By Michael Zhang 2015/11/06 | Source: | Category: who
Rating: |  Discuss |   Briefcase | 1,389 reads

First day and last day of a week

This scripts calculates the first day and the last day of a given week  Read more...
By Kamel AL GAZZAH 2015/11/10 | Source: | Category: date calculations
Rating: |  Discuss |   Briefcase | 878 reads

Drop All Temp Tables For Connection

Stored Procedure that will drop all temporary tables for your connection.  Read more...
Rating: |  Discuss |   Briefcase | 1,074 reads

Data Compression

This script is used to compress tables and indexes. It is designed for page compression on all. Just a little ditty to help with our EDW storage and processing.  Read more...
By Eric Blake 2015/11/11 | Source: | Category: compression
Rating: |  Discuss |   Briefcase | 962 reads
   Items 1 to 20 of 3240    Older >>