SQL Clone
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

   Items 1 to 20 of 3541    Older >>
 

Quick SQL connection and process details with current SQL - Version2

Quick check SQL connection and process details with current SQL text  Read more...
By Venugopal Saride 2018/12/06 | Source: SQLServerCentral.com | Category: sid
Rating: |  Discuss |   Briefcase | 331 reads

EmbeddedSplit8K

Starting from a string, it returns values embedded in delimiters.  Read more...
By Carlo Romagnano 2018/11/29 | Source: SQLServerCentral.com | Category: splitting strings
Rating: (not yet rated) |  Discuss |   Briefcase | 207 reads

Automatically Failover (Enable or Disable) Jobs Based on HADR Role

If you have a SQL Server with a High Availability solution (AlwaysOn Availability Groups, Database Mirroring, etc.), and you also have a bunch of jobs which you need to be run on the Primary server only. You need to be able to "failover" the jobs in case the Primary server is no longer Primary.  Read more...
By Eitan Blumin 2018/11/14 | Source: SQLServerCentral.com | Category: always on
Rating: (not yet rated) |  Discuss |   Briefcase | 198 reads

Data Dictionary

I use this script to create data dictionaries.   Read more...
By Timothy Harms 2018/11/15 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 387 reads

String Replace in Stored Procedures with Powershell

Find a string in a stored procedure and replace with powershell  Read more...
By Michael D'Spain 2018/11/13 | Source: SQLServerCentral.com | Category: powershell
Rating: (not yet rated) |  Discuss |   Briefcase | 230 reads

Parsing INTERNAL REPRESENTATION OF OVERPUNCH SIGNS

Some times you need to parse over punch values at the while running a query. Here is an utility function to help with that task.   Read more...
By Bernabe Diaz 2018/11/07 | Source: SQLServerCentral.com | Category: parsing
Rating: (not yet rated) |  Discuss |   Briefcase | 123 reads

view generator

generate views for all tables in a source schema in a target schema. the view will have the same name as source tables  Read more...
By Flashx 2018/11/08 | Source: SQLServerCentral.com | Category: views
Rating: |  Discuss |   Briefcase | 305 reads

Disk Space Check

I was using this script to check disk space on individual servers for quite some time. And now since I started to use registered servers for MS SQL, I thought of a little modification to the script.   Read more...
By Rinu George Philip 2018/11/09 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 285 reads

sp_what

Better* than sp_who2, with less re-checking data to get answers. Also, it is SnaZy. With a capital Z. *Dont you just love totally non subjective assessments like this?  Read more...
By Nicholas Williams 2018/11/01 | Source: SQLServerCentral.com | Category: blocks
Rating: |  Discuss |   Briefcase | 590 reads

Prevent accidental DB drop\delete

This script trigger will help you to accidental DB drop/delete  Read more...
By Subhash Chandra 2018/11/05 | Source: SQLServerCentral.com | Category: drop
Rating: |  Discuss |   Briefcase | 330 reads

The Pesky Windows Power Plan Oh My

The below script will build a csv file for import of the servers Power Plan Setting.  Read more...
By Edward Pochinski 2018/11/06 | Source: SQLServerCentral.com | Category: administration
Rating: |  Discuss |   Briefcase | 216 reads

sp_helpindex2

modernized sp_helpindex with info on post S2K features  Read more...
By Joe Chang 2018/10/29 | Source: SQLServerCentral.com | Category: indexing
Rating: |  Discuss |   Briefcase | 301 reads

sp_spaceused2

extensions to sp_spaceused  Read more...
By Joe Chang 2018/10/24 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 357 reads

Mechanism To Dynamically Build Pivot Table

Script to build PIVOT queries with an arbitrary number of columns  Read more...
By Gaby Abed 2018/10/25 | Source: SQLServerCentral.com | Category: pivot table
Rating: |  Discuss |   Briefcase | 378 reads

View Server Roles and Permissions per Login

obtain server roles and permissions by login  Read more...
By Perry Whittle 2018/10/12 | Source: SQLServerCentral.com | Category: server roles
Rating: |  Discuss |   Briefcase | 342 reads

How to Identify backup tables within production databases

How to identify backup tables within production databases that can be removed.   Read more...
Rating: |  Discuss |   Briefcase | 247 reads

Detect and Repair Non Trusted Foreign Keys

Create the code to detect and repair non trusted foreign keys  Read more...
By Ronald Hensbergen 2018/10/23 | Source: SQLServerCentral.com | Category: foreign keys
Rating: |  Discuss |   Briefcase | 202 reads

Purging table script

Script to purge big tables in small batches of 500  Read more...
By Abhishek Dwivedi 2018/09/26 | Source: SQLServerCentral.com | Category: purgingtable
Rating: (not yet rated) |  Discuss |   Briefcase | 94 reads

Conditionally Order By Different Column

Order records based on a different column depending on which absolute value is greater.  Read more...
By Noel Scheaffer 2018/10/01 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 381 reads

Data Collections restart and clear cache files

Script to stop the default Data Collection sets, clear the cache files and then restart collection sets.  Read more...
By Matt Frend 2018/10/02 | Source: SQLServerCentral.com | Category: data collections
Rating: (not yet rated) |  Discuss |   Briefcase | 132 reads
   Items 1 to 20 of 3541    Older >>