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

Get Client IP Address in SQL Server

A function for getting Client IP Address in SQL Server  Read more...
By Sarvesh Gupta 2014/08/05 | Source: SQLServerCentral.com | Category: ip address
Rating: |  Discuss |   Briefcase | 1,833 reads

Code For Truncating Table with foreign Key Constraints

This can be used for data warehouses as well as truncating table with foreign key constraints.  Read more...
By Vimal Lohani 2014/08/06 | Source: SQLServerCentral.com | Category: truncating tables
Rating: |  Discuss |   Briefcase | 1,582 reads

Rename a SQL Server database

This script allows you to rename a database.  Read more...
By v.raguram1989 2014/08/08 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 1,249 reads

Script to generate the SQL to create a fulltext catalog and its underlying fulltext index

This script was published originally on http://humakhurshid.blog.com/2011/07/14/script_out_fulltext_catalog/ The author has tweaked it little bit to improve it.  Read more...
By awais9981 2014/08/07 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 724 reads

Simple script to list out SPID, Program_name and login details

If you have any requirement where you want to find out all the SPIDs running on a database along with the program/application name of the SPID and the login details. You can run the procedure to get the details very easily.  Read more...
By S M 2014/08/12 | Source: SQLServerCentral.com | Category: spid
Rating: |  Discuss |   Briefcase | 1,385 reads

Find Most Expensive Stored PROCEDURE

SQL Server Stored Procedure Execute Count Script ..   Read more...
By Yusuf Kahveci 2014/08/19 | Source: SQLServerCentral.com | Category: performance
Rating: |  Discuss |   Briefcase | 2,512 reads

Report overlapping jobs

This script reports jobs which are running when another job is also running. This could be a reason for performance degradations.  Read more...
By Wilfred van Dijk 2014/07/31 | Source: SQLServerCentral.com | Category: sqlagent
Rating: |  Discuss |   Briefcase | 1,163 reads

Find Data in Alpha Columns

Given a bit of Alpha data, this script looks in all alpha columns in the database. It returns simple queries that produced rows in order to allow you to verify that the data that was sought was actually found.  Read more...
By Kevin Herr 2014/08/01 | Source: SQLServerCentral.com | Category: search database
Rating: |  Discuss |   Briefcase | 636 reads

CTE DML

This script is an example explaining how to write DML using CTE.  Read more...
By kbhanu15 2014/07/23 | Source: SQLServerCentral.com | Category: dml
Rating: |  Discuss |   Briefcase | 1,264 reads

Move End of Month file from source to destination

The script below executes on the first of every month and moves files from source to destination location.   Read more...
By Prem Kumar 2014/07/24 | Source: SQLServerCentral.com | Category: move files
Rating: |  Discuss |   Briefcase | 805 reads

Yet another way to defrag indexes

A script we use in our company, that rebuilds online=on by default, but takes care of special exceptions.  Read more...
By Gaby Abed 2014/07/25 | Source: SQLServerCentral.com | Category: defragmentation
Rating: |  Discuss |   Briefcase | 1,305 reads

Find server in complex CMS hierarchy

List all the instances with their paths as stored on CMS.  Read more...
By Cheetah 2014/07/28 | Source: SQLServerCentral.com | Category: list
Rating: (not yet rated) |  Discuss |   Briefcase | 366 reads

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 | 907 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,150 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,278 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 | 2,023 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,866 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,855 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 | 736 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 | 2,371 reads
<< Newer    Items 21 to 40 of 3033    Older >>