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

<< Newer    Items 41 to 60 of 3273    Older >>

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 | 1,306 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/26 | Source: | Category: db name
Rating: |  Discuss |   Briefcase | 1,110 reads

Constraints renaming

Rename constraints to enforce naming conventions. 
By Luis Cazares 2015/11/18 | Source: | Category: constraints
Rating: |  Discuss |   Briefcase | 657 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: |  Discuss |   Briefcase | 1,290 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 | 554 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 | 824 reads

Read SQL Error logs

Query to read error logs from current/archive files  
Rating: |  Discuss |   Briefcase | 1,753 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 | 890 reads

Mirroring Automation

Automating the Mirroring configuration for new databases 
By Vasan Balu 2015/11/16 | Source: | Category: mirroring
Rating: |  Discuss |   Briefcase | 1,030 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,671 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 | 1,015 reads

Drop All Temp Tables For Connection

Stored Procedure that will drop all temporary tables for your connection.  Read more...
Rating: |  Discuss |   Briefcase | 1,208 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 | 1,108 reads

Get FirstDate and LastDate of Every month from two Dates

Get FirstDate and LastDate of Every month from two Dates. Like IF we have @date1='05/02/2015' and @date2= '11/25/2015' then we will get list of first date and last date from month 5 to 11. SELECT ID,FirstDate,LastDate,Month,Year FROM [GetFLDatelist](@date1,@date2)  Read more...
Rating: |  Discuss |   Briefcase | 1,142 reads

Alter all/specific columns by double dynamic SQL

The script uses dynamic SQL twice first to get the detail about the database structure and create ddl out of it second to execute each DDL created  Read more...
By Ashish Shevale 2015/11/03 | Source: | Category: alter
Rating: |  Discuss |   Briefcase | 857 reads

Rebuild index selectively

Rebuild index is expensive most time. So you don't rebuild all index blindly.  Read more...
Rating: |  Discuss |   Briefcase | 1,508 reads

Update statistics

Update statistics older 1 day 
By Dmitriy Ivanov 2015/10/07 | Source:
Rating: (not yet rated) |  Discuss |   Briefcase | 1,374 reads

copy and rename multiple databases

This is to clone multiple databases using a list with oldname,newname. optionally the original database can be deleted in the process.  Read more...
Rating: |  Discuss |   Briefcase | 907 reads

Capture the tasks performed in a text file

Creates a record of all or part of a Windows PowerShell session in a text file.  Read more...
Rating: |  Discuss |   Briefcase | 930 reads

Calculate relative time

dynamically calculates a timestamp 
By Wilfred van Dijk 2015/09/30 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,344 reads
<< Newer    Items 41 to 60 of 3273    Older >>