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

   Items 1 to 20 of 3383    Older >>
 

Query Performance comparison between instances

Execute at source, and will generate an output with TSQL commands to create temp tables filled with top 50 long lasting queries from all databases. Then execute output at destination and will do the same and show comparison of matching queries!!   Read more...
By Rodrigo Acosta 2016/12/06 | Source: SQLServerCentral.com | Category: query
Rating: (not yet rated) |  Discuss |   Briefcase | 24 reads

Check constraint to prevent insertion of invalid characters.

A column level check constraint may be used to prevent insertion of data containing characters within a specific ASCII range.  Read more...
By Eric Russell 2016/11/30 | Source: SQLServerCentral.com | Category: constraints
Rating: (not yet rated) |  Discuss |   Briefcase | 34 reads

Truncate tables with foreign keys

Truncating tables with constraints always had been a pain, since we have to drop and recreate all the FKs. I created a script that takes care of dropping and recreating the foreign keys while truncating. Please use with caution! and always respect your Data !  Read more...
By Roshan Joe Joseph 2016/12/01 | Source: SQLServerCentral.com | Category: truncate
Rating: |  Discuss |   Briefcase | 529 reads

Fix Orphan Users

Fix Orphan Users  Read more...
By S M 2016/11/30 | Source: SQLServerCentral.com | Category: orphan users
Rating: |  Discuss |   Briefcase | 428 reads

Find unused columns

Script finds all columns in a table that have a single value.  Read more...
By Clay Punnett 2016/11/28 | Source: SQLServerCentral.com | Category: columns
Rating: |  Discuss |   Briefcase | 471 reads

Warm the cache with a table and its indexes

Warm the cache with a particular table by reading it into memory.  Read more...
By Doran Mackay 2016/11/25 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 372 reads

Return VARCHAR Between 2 Character sets

This Function Will Return the VARCHAR found between 2 Different VARCHAR sets.  Read more...
By Martin Scheepers 2016/11/23 | Source: SQLServerCentral.com | Category: string manipulation
Rating: |  Discuss |   Briefcase | 256 reads

Change Stored Procedure Automaticly

Script describe How to change stored procedure Automaticly.  Read more...
By ESAT ERKEC 2016/11/22 | Source: SQLServerCentral.com | Category: stored procedure
Rating: |  Discuss |   Briefcase | 546 reads

Generate add / alter script for missing / different type columns

This query generate add/alter script for missing or different columns. Execute on source database and copy resultset. Execute generated script on any database (may be all customer databases) Missing columns will be created and different types will change as source schema.  Read more...
By Ercument Eskar 2016/11/18 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 341 reads

Change Login Auditing Option

Configure Login Auditing   Read more...
By ESAT ERKEC 2016/11/14 | Source: SQLServerCentral.com | Category: security
Rating: (not yet rated) |  Discuss |   Briefcase | 212 reads

Converting values into Rows

Script describe one of the way to divide values into rows by using any specified dividing value.  Read more...
Rating: |  Discuss |   Briefcase | 526 reads

Function - Word count in a sentence

The function (Inline function) is used to determine the word count in a textual/string input. * Compatible from SQL Server 2012 and up.  Read more...
By Hannan Kravitz 2016/11/11 | Source: SQLServerCentral.com | Category: string manipulation
Rating: |  Discuss |   Briefcase | 297 reads

Equivalent Oracle's INSTR Function in SQL server

Oracle Built in Function INSTR is a great function if you wish to locate a string or a subset of string in the nth place.  Read more...
By Hannan Kravitz 2016/11/17 | Source: SQLServerCentral.com | Category: substring
Rating: |  Discuss |   Briefcase | 400 reads

Create Database Snapshot Dynamically

Dynamic SQL can be used to generate a database snapshot. Useful for a database with a number of files.  Read more...
By Joe McDermott 2016/11/16 | Source: SQLServerCentral.com | Category: snapshot
Rating: (not yet rated) |  Discuss |   Briefcase | 270 reads

Build restore scripts dynamically

This script will build restore scripts with the most recent full backup and all t-log backups since, for each user database in the SQL instance.  Read more...
By Brian R.A. Smith 2016/11/09 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 483 reads

Taking backup of the databases to the Active server alone

If you have Always On and need to stop running database backups to the stand by server, use the script.  Read more...
By S M 2016/11/21 | Source: SQLServerCentral.com | Category: always on
Rating: |  Discuss |   Briefcase | 165 reads

Create Sub Directory with Database name and .BAK

This Syntax will create Sub Directory at DRIVE D:\backup\  Read more...
By Deny Christian 2016/11/01 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 381 reads

Find the position of Nth repeated char/string

Find the position of Nth repeated char or string  Read more...
By Hemant Ray 2016/10/26 | Source: SQLServerCentral.com | Category: string manipulation
Rating: |  Discuss |   Briefcase | 554 reads

Function - Convert Public LinkedIn URL to Premium URL

For those who have a contacts database with associated LinkedIn Profile URLs. Many "/pub/" URLs do not successfully redirect to their "/in/" counterparts.  Read more...
By Kristofer Pearson 2016/10/27 | Source: SQLServerCentral.com | Category: string manipulation
Rating: (not yet rated) |  Discuss |   Briefcase | 284 reads

Refresh all views in a database

Refresh all views in a database  Read more...
By S M 2016/10/28 | Source: SQLServerCentral.com | Category: views
Rating: |  Discuss |   Briefcase | 503 reads
   Items 1 to 20 of 3383    Older >>