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 3275    Older >>
 

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 with multiple columns or where the unique identity is contained in other indexes.  Read more...
By Doran Mackay 2015/11/24 | Source: SQLServerCentral.com | Category: database design
Rating: (not yet rated) |  Discuss |   Briefcase | 79 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: SQLServerCentral.com | Category: database design
Rating: |  Discuss |   Briefcase | 888 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: SQLServerCentral.com | Category: database
Rating: |  Discuss |   Briefcase | 1,312 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: SQLServerCentral.com | Category: db name
Rating: |  Discuss |   Briefcase | 1,113 reads

Constraints renaming

Rename constraints to enforce naming conventions.  Read more...
By Luis Cazares 2015/11/18 | Source: SQLServerCentral.com | Category: constraints
Rating: |  Discuss |   Briefcase | 658 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: SQLServerCentral.com | Category: space
Rating: |  Discuss |   Briefcase | 1,293 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: SQLServerCentral.com | 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: SQLServerCentral.com | Category: administration
Rating: |  Discuss |   Briefcase | 824 reads

Read SQL Error logs

Query to read error logs from current/archive files   Read more...
Rating: |  Discuss |   Briefcase | 1,759 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: SQLServerCentral.com | Category: variables
Rating: (not yet rated) |  Discuss |   Briefcase | 891 reads

Mirroring Automation

Automating the Mirroring configuration for new databases  Read more...
By Vasan Balu 2015/11/16 | Source: SQLServerCentral.com | Category: mirroring
Rating: |  Discuss |   Briefcase | 1,032 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: SQLServerCentral.com | Category: who
Rating: |  Discuss |   Briefcase | 1,672 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: SQLServerCentral.com | 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,211 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: SQLServerCentral.com | Category: compression
Rating: |  Discuss |   Briefcase | 1,109 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: SQLServerCentral.com | 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,510 reads

Update statistics

Update statistics older 1 day  Read more...
By Dmitriy Ivanov 2015/10/07 | Source: SQLServerCentral.com
Rating: (not yet rated) |  Discuss |   Briefcase | 1,376 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
<< Newer    Items 41 to 60 of 3275    Older >>