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 81 to 100 of 3304    Older >>
 

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,038 reads

Drop All Temp Tables For Connection

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

Rebuild index selectively

Rebuild index is expensive most time. So you don't rebuild all index blindly.  Read more...
Rating: |  Discuss |   Briefcase | 1,613 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,431 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 | 919 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 | 945 reads

Calculate relative time

dynamically calculates a timestamp  Read more...
By Wilfred van Dijk 2015/09/30 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,364 reads

Open Transaction details

sql server blocking, open transaction  Read more...
By S M 2015/10/01 | Source: SQLServerCentral.com | Category: transactions
Rating: |  Discuss |   Briefcase | 1,629 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: SQLServerCentral.com | Category: version
Rating: |  Discuss |   Briefcase | 1,470 reads

PoSh: Get-WhoInstallSQL

Useful function that finds who installed SQL Server  Read more...
By Miguel Quintana 2015/09/28 | Source: SQLServerCentral.com | Category: powershell
Rating: |  Discuss |   Briefcase | 1,025 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: SQLServerCentral.com | Category: arithmetic expression
Rating: |  Discuss |   Briefcase | 1,111 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: SQLServerCentral.com | Category: documentation
Rating: |  Discuss |   Briefcase | 1,683 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: SQLServerCentral.com | Category: alter index
Rating: |  Discuss |   Briefcase | 878 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: SQLServerCentral.com | Category: logins
Rating: |  Discuss |   Briefcase | 1,633 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: SQLServerCentral.com | Category: documentation
Rating: |  Discuss |   Briefcase | 1,143 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: SQLServerCentral.com | Category: statistics
Rating: |  Discuss |   Briefcase | 865 reads

Execute SQL Script against Multiple Servers by PowerShell

Execute SQL Script against Multiple Servers by PowerShell  Read more...
By Raushan 2015/08/21 | Source: SQLServerCentral.com | Category: powershell
Rating: |  Discuss |   Briefcase | 1,797 reads
<< Newer    Items 81 to 100 of 3304    Older >>