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 61 to 80 of 3426    Older >>

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 | 959 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 | 301 reads

Refresh all views in a database

Refresh all views in a database 
By S M 2016/10/28 | Source: SQLServerCentral.com | Category: views
Rating: |  Discuss |   Briefcase | 598 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 | 427 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 | 336 reads

Date calculation

Data calculation in form yy mm dd 
By Darko Martinovic 2016/10/17 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 555 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 | 705 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 | 663 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 | 438 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 | 619 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 | 714 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 | 876 reads

Delete Files in Shared Location/SAN

Delete files via TSQL procedure in shared location 
Rating: (not yet rated) |  Discuss |   Briefcase | 357 reads

Handling with currently running and blocking sessions

Checks currently running sessions and blocking queries with session information  Read more...
By Sheraz Mirza 2016/10/05 | Source: SQLServerCentral.com | Category: current running sessions
Rating: |  Discuss |   Briefcase | 545 reads

Create EndPoint

Server principal 'xx\yy' has granted one or more permission(s). Revoke the permission(s) before dropping the server principal. (Microsoft SQL Server, Error: 15173). If you are gett  Read more...
By S M 2016/10/03 | Source: SQLServerCentral.com | Category: database mirroing
Rating: |  Discuss |   Briefcase | 287 reads

Expand Template with Values from Result Set

This stored procedure extracts template variable names and values from a SQL result set in order to process the template.  Read more...
By Bill Cowan 2016/10/13 | Source: SQLServerCentral.com | Category: sql generation
Rating: (not yet rated) |  Discuss |   Briefcase | 295 reads

Find databases without backup

Find databases without backup and alert you by email with databases affected  Read more...
By Angel Gómez 2016/09/30 | Source: SQLServerCentral.com | Category: script
Rating: |  Discuss |   Briefcase | 508 reads

Work time calculation

One way to calculate how many minutes a person has worked considering holidays and shifts, being given starting and ending date / time  Read more...
By Alessandro Mortola 2016/09/29 | Source: SQLServerCentral.com | Category: datefirst
Rating: (not yet rated) |  Discuss |   Briefcase | 409 reads

Rebuild All Indexes in a Database (Tables/Views)

This script rebuilds all indexes in a selected database (tables and indexed views). Ifm you have a very large Database with many indexes and indexed views please consider before you run this script it might take a while to run. I myself run it around once a month after new data comes my way  Read more...
By Angel Rapallo 2016/09/28 | Source: SQLServerCentral.com | Category: index
Rating: |  Discuss |   Briefcase | 606 reads

Backup History for all databases

Return the 600 last days of backup history for all databases  Read more...
Rating: |  Discuss |   Briefcase | 425 reads
<< Newer    Items 61 to 80 of 3426    Older >>