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

<< Newer    Items 81 to 100 of 3453    Older >>
 

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 | 709 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 | 379 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 | 511 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: |  Discuss |   Briefcase | 366 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 | 1,165 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 | 193 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 | 426 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 | 1,165 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 | 310 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 | 697 reads

Getting top ranked employee detail for each department

Using OVER clause with ROW_NUMBER() function to get top ranked employee detail as per each department.   Read more...
By Sheraz Mirza 2016/10/25 | Source: SQLServerCentral.com | Category: over clause
Rating: |  Discuss |   Briefcase | 456 reads

Calculate two internships

Calculates total length of services for a employee. Calculates( addition or subtraction) two internships in form of yy.mm.dd   Read more...
By Darko Martinovic 2016/10/19 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 379 reads

Date calculation

Data calculation in form yy mm dd  Read more...
By Darko Martinovic 2016/10/17 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 647 reads

SQLCMD to export data in txt file

SQLCMD is one of many methods to export your database data to some text file  Read more...
By Sheraz Mirza 2016/10/12 | Source: SQLServerCentral.com | Category: sqlcmd
Rating: |  Discuss |   Briefcase | 810 reads

Recompile All Databases stored Procedures

When code is getting stall, sometimes the execution plans are point to the wrong or out dated or old objects. You would need to recompile all the stored procedures  Read more...
By Mark Huber 2016/10/14 | Source: SQLServerCentral.com | Category: recompile
Rating: |  Discuss |   Briefcase | 694 reads

Change datetime

If you have any requirement to extract next 100 sequential date from a present date, you can use the below script. You can change the @datetimeformat value and the output will appear in the same format.  Read more...
By S M 2016/10/10 | Source: SQLServerCentral.com | Category: date manipulation
Rating: |  Discuss |   Briefcase | 454 reads

Shrink Tlog Files

DBA many a times need to shrink the log files if that grows very large. Though I am not recommending to do it daily or often but if space is an issue and you want to release space to OS, you may use the script.  Read more...
By S M 2016/10/11 | Source: SQLServerCentral.com | Category: dbcc shrinkfile
Rating: |  Discuss |   Briefcase | 670 reads

Enable Email Notification to all SQL Jobs

If you have a requirement to enable email notification to all the SQL Jobs, then you may use my script.  Read more...
By S M 2016/10/06 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 751 reads

Identify tempdb usage

Identifies SQL and or Jobs that are using tempdb space.  Read more...
By David Kranes 2016/10/07 | Source: SQLServerCentral.com | Category: tempdb
Rating: (not yet rated) |  Discuss |   Briefcase | 934 reads

Delete Files in Shared Location/SAN

Delete files via TSQL procedure in shared location  Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 378 reads
<< Newer    Items 81 to 100 of 3453    Older >>