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

<< Newer    Items 41 to 60 of 2949    Older >>

Generate merge script for all primary key tables in a database

This code generates merge scripts in the form of individual stored procedures for each table within a specified database. Once executed, simply highlight the results within the following columns altogether and past into a new window: SET_OPERATOR, AND_OPERATOR, COLUMN_SQL Enjoy  Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 845 reads

Template - Type 6 SCD Stored Procedure

Template to create a Type 6 slowly changing dimension stored procedure  Read more...
By Marie Bayer 2014/03/05 | Source: | Category: template
Rating: |  Discuss |   Briefcase | 1,090 reads

Calendar Table by Year

Populate a calendar table with user set interval start and end datetime values.  Read more...
By Marie Bayer 2014/03/11 | Source: | Category: reporting
Rating: (not yet rated) |  Discuss |   Briefcase | 844 reads

Calendar Table by Month

Populate a calendar table with user set interval start and end datetime values.  Read more...
By Marie Bayer 2014/03/10 | Source: | Category: reporting
Rating: |  Discuss |   Briefcase | 904 reads

Calendar Table by Day

Populate a calendar table with user set interval start and end datetime values.  Read more...
By Marie Bayer 2014/03/12 | Source: | Category: reporting
Rating: |  Discuss |   Briefcase | 649 reads

Calendar Table by Interval Minutes

Populate a calendar table with user set interval start and end datetime values.  Read more...
By Marie Bayer 2014/03/06 | Source: | Category: calendar
Rating: |  Discuss |   Briefcase | 891 reads

The dynamic unpivoter.

Have you ever wanted to dynamically unpivot a table?  Read more...
By John Corcoran 2014/04/22 | Source: | Category: unpivot
Rating: |  Discuss |   Briefcase | 1,460 reads

Find Size of files used in Database

This script will help in identifying file size of primary file, log file and all partition files. This include free space available and space used for each file in a database.  Read more...
By Nitesh Dedhia 2014/03/03 | Source: | Category: filesize
Rating: |  Discuss |   Briefcase | 970 reads

Get the all the tables on the server which do not have Clustered index

Get the list of the tables on the server which dont have the clustered index.  Read more...
By Mitesh Oswal 2014/02/24 | Source: | Category: clustered index
Rating: |  Discuss |   Briefcase | 1,089 reads

SP Send Query Result as HTML table using DBMail

Create a stored procedure that will send the result of a query as an html table from the database mail.  Read more...
By Dave Gugg 2014/02/25 | Source: | Category: db_mail
Rating: |  Discuss |   Briefcase | 1,429 reads

Create a copy of database with a new name

Create Copy of database with new name. 
By Mitesh Oswal 2014/02/27 | Source:
Rating: |  Discuss |   Briefcase | 1,330 reads

List Table Foreign Keys, Primary key and indexes

This procedure let you list [optional] by table: -Foreign keys -Primary key -Indexes   Read more...
By Martin Collazos 2014/02/18 | Source: | Category: foreign key list
Rating: |  Discuss |   Briefcase | 1,549 reads

Compress All Objects

Creates compression scripts for all objects in all databases in the instance.  Read more...
By Jakob Bindslet 2014/02/11 | Source: | Category: compression
Rating: |  Discuss |   Briefcase | 757 reads


This will name Ignite SQL hashes that have not been named yet, based on the object (or batch) they are within.  Read more...
By Thomas Keller 2014/02/05 | Source: | Category: performance tuning
Rating: (not yet rated) |  Discuss |   Briefcase | 539 reads


Here's a quick query you can run across all your servers (2012) to find a wealth of information like service pack, edition, number of CPUs and RAM. Even more is available if you want to add additional SERVERPROPERTY attributes or fields from one of the DMVs.  Read more...
Rating: |  Discuss |   Briefcase | 1,355 reads

Auto dump out database schema

This powershell script will dump out a database schema to a text file.  Read more...
By Neil Bryan 2014/02/04 | Source: | Category: schema
Rating: |  Discuss |   Briefcase | 1,246 reads

Convert Months,Days,ShortMonths to different Languages

Convert Months,Days,ShortMonths to Different Langauges with out sql server set language function can be used in views tables and stored procedures also includes proper case conversion  Read more...
By William McLaughlin 2014/02/03 | Source: | Category: dates
Rating: (not yet rated) |  Discuss |   Briefcase | 822 reads

Total space used per table

I have received some comments on getting total space of table and all indexes. Therefore I rewrote previous query and it returns total space used, space used by heap table or clustered index and space used by non-clustered indexes.  Read more...
By Louis Li 2014/01/29 | Source: | Category: table space
Rating: |  Discuss |   Briefcase | 1,543 reads

Calculate Table Size and row count

This script calculates table row count and size(MB), as well as the used space and free space.  Read more...
Rating: |  Discuss |   Briefcase | 1,473 reads

To check the full backup duration of an SQL Instance

This script will check the full backup time taken by all the databases of an SQL Server instance.  Read more...
By Shashikant Shakya 2014/01/13 | Source: | Category: backup
Rating: |  Discuss |   Briefcase | 1,136 reads
<< Newer    Items 41 to 60 of 2949    Older >>