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

Drop All Temp Tables For Connection

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

Rebuild index selectively

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

Update statistics

Update statistics older 1 day 
By Dmitriy Ivanov 2015/10/07 | Source:
Rating: (not yet rated) |  Discuss |   Briefcase | 1,237 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 | 852 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 | 891 reads

Calculate relative time

dynamically calculates a timestamp 
By Wilfred van Dijk 2015/09/30 | Source: | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,293 reads

Open Transaction details

sql server blocking, open transaction 
By S M 2015/10/01 | Source: | Category: transactions
Rating: |  Discuss |   Briefcase | 1,465 reads

Get Server version Info

Yet another Script To get Sql server version Info. Run From Central Management server to get all your environment servers  Read more...
By Mark Huber 2015/09/29 | Source: | Category: version
Rating: |  Discuss |   Briefcase | 1,338 reads

PoSh: Get-WhoInstallSQL

Useful function that finds who installed SQL Server 
By Miguel Quintana 2015/09/28 | Source: | Category: powershell
Rating: |  Discuss |   Briefcase | 922 reads

Show solving arithmetic expression step by step

A script to show how to solve arithmetic expressions step-by-step, for my 9-year old daughter.  Read more...
By Kevin Duan 2015/09/25 | Source: | Category: arithmetic expression
Rating: |  Discuss |   Briefcase | 1,034 reads

Document the output of all the SPs in HTML fashion

A script to document the output columns of all the SPs in a given database, with a HTML formatted document  Read more...
By Enrico Di Cesare 2015/09/24 | Source: | Category: documentation
Rating: |  Discuss |   Briefcase | 1,527 reads

Block altering indexed views.

Altering an indexed view will drop all indexes on it without warning, even if nothing is changed. This will prevent accidental alters. Script is divided into 4 parts, included testing and cleanup scripts.  Read more...
By Dennis Post 2015/09/01 | Source: | Category: alter index
Rating: |  Discuss |   Briefcase | 719 reads

Generate Login Script(2008R2 And Older)

Generate Script from Logins of Sql Server to recreate in another instance  Read more...
By Bahram Shayan 2015/08/25 | Source: | Category: logins
Rating: |  Discuss |   Briefcase | 1,522 reads

Registered server documenter

Returns server and instance information via a registered server query, regardless of SQL version. This script is more of how to get the data, and not so much about the data returned by my choice of columns. Tested on 2008+  Read more...
By Dennis Post 2015/08/28 | Source: | Category: documentation
Rating: |  Discuss |   Briefcase | 1,065 reads

Duplicate Stats

Give list of Duplicate Stats up to 9 cols...not just dupes but also covering...if one stats covers another its listed. Given pair only listed once if dupe.  Read more...
By John Heimiller 2015/08/26 | Source: | Category: statistics
Rating: |  Discuss |   Briefcase | 799 reads

Execute SQL Script against Multiple Servers by PowerShell

Execute SQL Script against Multiple Servers by PowerShell 
By Raushan 2015/08/21 | Source: | Category: powershell
Rating: |  Discuss |   Briefcase | 1,519 reads

Cleanup Older than 30 days of Files & Folder through SQL Job

Using Powershell, Cleanup Older than 30 days of Files & Folder through SQL Job  Read more...
By S M 2015/08/24 | Source: | Category: powershell
Rating: |  Discuss |   Briefcase | 1,307 reads
<< Newer    Items 21 to 40 of 3242    Older >>