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

<< Newer    Items 21 to 40 of 3021    Older >>
 

Generate Restore script for multiple databases

Restore script for moving databases from prod to dev with different path / logical name etc.  Read more...
By Taranjit Singh 2014/08/14 | Source: SQLServerCentral.com | Category: restore
Rating: |  Discuss |   Briefcase | 673 reads

Drop Any Object if it exists

This procedure drops any object if it exists not including temp tables.  Read more...
By Rob Sumsion 2014/07/29 | Source: SQLServerCentral.com | Category: drop
Rating: |  Discuss |   Briefcase | 1,033 reads

Dynamic Shrink Log file on server

We are required to shrink the log file to make space on server.  Read more...
By Mitesh Oswal 2014/08/11 | Source: SQLServerCentral.com | Category: log file maintenance
Rating: |  Discuss |   Briefcase | 1,019 reads

Calculating Working Hours

Calculating working hours can be painful due to all the variances that they imply. This function will calculate working hours between 2 dates which might include time. There's an option to use a holidays table that will vary in each environment.  Read more...
By Luis Cazares 2014/07/09 | Source: SQLServerCentral.com | Category: working hours
Rating: |  Discuss |   Briefcase | 1,836 reads

Physical Server or a Virtual Machine?

Simple T-SQL Script to know whether your SQL Server is running on a Physical box or a VM. Note: This Script works only on 2008R2 SP1 and above.   Read more...
By SreeSql 2014/07/14 | Source: SQLServerCentral.com | Category: administration
Rating: |  Discuss |   Briefcase | 2,651 reads

Create MERGE statements with data!

A script to create MERGE statements with data for specific tables.  Read more...
By Jason Selburg 2014/07/16 | Source: SQLServerCentral.com | Category: merge
Rating: |  Discuss |   Briefcase | 2,433 reads

Object dependencies in xml format

Most of the people know about the right-click option 'View Dependencies' in the SQL Management Studio. It will diplay expandable tree off all dependencies each way. Correct me if I'm wrong, but I couldn't find any other way to save this othere than taking a screenshot of the window.  Read more...
By Peter Sloboda 2014/07/21 | Source: SQLServerCentral.com | Category: object dependencies
Rating: (not yet rated) |  Discuss |   Briefcase | 672 reads

Reindex Procedure with a Twist (or two) the SQL

A 2012 update to "Reindex Procedure with a Twist (or two)":   Read more...
By Keith Hays 2014/07/11 | Source: SQLServerCentral.com | Category: indexing
Rating: |  Discuss |   Briefcase | 1,993 reads

Column Exists or not?

Function to know column Exists or not in the Table?  Read more...
By Shiva N (AxSys) 2014/07/22 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 1,580 reads

Check Backups

Daily maintenance script to check on backups  Read more...
By Greg Ryan 2014/07/04 | Source: SQLServerCentral.com | Category: backups
Rating: |  Discuss |   Briefcase | 1,896 reads

SQL Server CPU Usage History Histogram

Returns a summary of CPU usage by SQL Server over the last 4 hours (default). Using the sample values collected in the dm_os_ring_buffers dmv, this query will show CPU usage by the SQL Server process for the last for hours even if you have no other benchmarking activities in place on your server yet.  Read more...
By Jonathan Allen 2014/07/07 | Source: SQLServerCentral.com | Category: performance
Rating: |  Discuss |   Briefcase | 2,199 reads

Avoid Transaction Logs volume from filling

Script for preventing the volumes of the transaction logs from filling.  Read more...
By Daniel Marques 2014/07/02 | Source: SQLServerCentral.com | Category: transaction logs
Rating: |  Discuss |   Briefcase | 1,960 reads

Find Transactional Replication Publisher

Finds the publisher, publisher database, and publication that your subscription table is replicated from.  Read more...
By Derik Hammer 2014/06/27 | Source: SQLServerCentral.com | Category: replication
Rating: (not yet rated) |  Discuss |   Briefcase | 314 reads

Find Transactional Replication Source from Destination Table

I wrote this script to help me locate the publisher, publication, published database, and source object for destination tables which might not be named the same or when you are in a large replication topology with dozens of publications.  Read more...
By Derik Hammer 2014/06/25 | Source: SQLServerCentral.com | Category: replication
Rating: |  Discuss |   Briefcase | 409 reads

Script out all alerts

Sometimes you want to copy all the alerts that you've got set up on one server to add them to another  Read more...
By Carolyn Richardson 2014/06/30 | Source: SQLServerCentral.com | Category: msdb
Rating: (not yet rated) |  Discuss |   Briefcase | 1,305 reads

Productivity Keyboard Shortcuts

something to help working with ssms.  Read more...
By Emil Bialobrzeski 2014/06/23 | Source: SQLServerCentral.com | Category: shortcuts
Rating: |  Discuss |   Briefcase | 1,802 reads

All Index Size

All Index Size  Read more...
By mkl-1013783 2014/06/18 | Source: SQLServerCentral.com | Category: indexing
Rating: |  Discuss |   Briefcase | 689 reads

Dynamic pivoting

Dynamically create and/or execute a pivot sql statement against a provided table.  Read more...
By Trevor Makoni 2014/06/16 | Source: SQLServerCentral.com | Category: pivot
Rating: |  Discuss |   Briefcase | 2,430 reads

Powershell script to report old backup files

Get a report of backups older than 60 days.  Read more...
By Rolando Hernandez 2014/05/30 | Source: SQLServerCentral.com | Category: backups
Rating: |  Discuss |   Briefcase | 758 reads

Start a job at a defined step on another sql instance

this is a powershell script that can start a job at a defined step name (default will be step 1), on a network instance either on a network on locally.  Read more...
By az352001 2014/06/04 | Source: SQLServerCentral.com | Category: jobs
Rating: |  Discuss |   Briefcase | 624 reads
<< Newer    Items 21 to 40 of 3021    Older >>