Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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 3156    Older >>
 

Magic 8 Ball

This script creates a stored procedure that mimics a Magic 8 Ball  Read more...
By Carlton Ramsey 2015/05/20 | Source: SQLServerCentral.com | Category: fun
Rating: (not yet rated) |  Discuss |   Briefcase | 38 reads

Execute All .SQL Script easily.

If you have a requirement to create Proc/Tables, etc to a SQL Server taking .SQL scripts from a central location (UNC), then you can use my script.  Read more...
By S M 2015/05/18 | Source: SQLServerCentral.com | Category: sql script- automation.
Rating: |  Discuss |   Briefcase | 38 reads

Count character matches with DATALENGTH function

https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Count%20character%20matches.sql  Read more...
By Konstantin Taranov 2015/05/18 | Source: SQLServerCentral.com | Category: string functions
Rating: (not yet rated) |  Discuss |   Briefcase | 38 reads

PatReplace8K

This inline table valued function takes three parameters: @String, @Pattern and @Replace. It located the @pattern in @string and replaces it with @replace.   Read more...
By Alan Burstein 2015/05/16 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 47 reads

Dynamic sql procedure for bulk insert

https://github.com/ktaranov/sqlserver-kit/blob/master/Strored%20Procedure/usp_BulkUpload.sql  Read more...
By Konstantin Taranov 2015/05/16 | Source: SQLServerCentral.com
Rating: (not yet rated) |  Discuss |   Briefcase | 85 reads

Complete Details About Backups Taken a Day Ago

Complete Details About Backups Taken a Day Ago.  Read more...
By S M 2015/05/15 | Source: SQLServerCentral.com | Category: sql server backup
Rating: |  Discuss |   Briefcase | 44 reads

Report Alerts from SQL ErrorLog

Sends Back Critical Alerts from ErrorLog occurred in the last 24 Hrs. You can even modify the data [Check @start and change the value]  Read more...
By S M 2015/05/15 | Source: SQLServerCentral.com | Category: sql errorlog
Rating: |  Discuss |   Briefcase | 99 reads

Query Performance Report

The procedure created by this script rolls up the collected query execution statistics and groups them daily by the plan hash value.  Read more...
By Steven Guest 2015/05/13 | Source: SQLServerCentral.com | Category: performance
Rating: (not yet rated) |  Discuss |   Briefcase | 145 reads

Standardize Object Names

Rename all database objects to use a standardize naming convention.  Read more...
By Cody Allen 2015/05/13 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 95 reads

Store a file & Retrive it in Sql Server

Store a file & Retrive it in Sql Server  Read more...
By Vimal Lohani 2015/05/12 | Source: SQLServerCentral.com | Category: binary data
Rating: |  Discuss |   Briefcase | 97 reads

Dynamic sql for convert SQL statement to txt/csv file

Github link: https://github.com/ktaranov/sqlserver-kit/blob/master/Strored%20Procedure/usp_bcpUnloadSelect.sql Quick export to flat file. Before use please enable xp_cmdshell.  Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 90 reads

Detach & Attach Procedure

For successful run, Your SQL Server service account should have permission to old location & new location  Read more...
By Vimal Lohani 2015/05/10 | Source: SQLServerCentral.com | Category: detach database
Rating: |  Discuss |   Briefcase | 41 reads

Query to find size of each disk file in a location

Query to find size of each file in a location  Read more...
By S M 2015/05/08 | Source: SQLServerCentral.com | Category: administration
Rating: |  Discuss |   Briefcase | 50 reads

Keyboard shortcut to select top 1000

select top * from table by highlighting the fully qualified, including database, table, using a keyboard shortcut.   Read more...
By Timothy Harms 2015/05/22 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 969 reads

Dynamic sql for convert table to flat file using bcp

I comment CATCH section for removing dependence to log procedures. Github link: https://github.com/ktaranov/sqlserver-kit/blob/master/Strored%20Procedure/usp_bcpTableUnload.sql  Read more...
By Konstantin Taranov 2015/05/21 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 883 reads

Wrapper

This can be used all codes deployed to an environment.  Read more...
By Timothy Harms 2015/05/06 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 78 reads

Script to document SQL Instance Details

SQL Script to document instance details  Read more...
Rating: |  Discuss |   Briefcase | 1,457 reads

Delete all files from a folder using xp_cmdshell

Delete all files from a folder using xp_cmdshell  Read more...
Rating: |  Discuss |   Briefcase | 579 reads

Dynamic Table Name on Select Into

Based upon todays date as suffix and chosen string as prefix, select data from predefined table into dynamically named new table. Script is properly error handled with most common errors  Read more...
By Jo Dacey 2015/05/14 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 1,255 reads
   Items 1 to 20 of 3156    Older >>