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 21 to 40 of 3452    Older >>
 

Compute Holiday Day of the Month for any Year

This script provides the day of the month for the standard bank holidays for any given year. This is especially useful for computing the workday after a holiday.  Read more...
By Eric Notheisen 2017/05/24 | Source: SQLServerCentral.com | Category: date computation
Rating: (not yet rated) |  Discuss |   Briefcase | 375 reads

Index Usage Stats

This script returns index usage stats along with drop and create DDL.  Read more...
By David Kranes 2017/05/16 | Source: SQLServerCentral.com | Category: tuning
Rating: |  Discuss |   Briefcase | 638 reads

Round Natural Numbers to the nearest Power of 10

An ITVF function that rounds a number to the nearest Power of 10   Read more...
By Hannan Kravitz 2017/05/15 | Source: SQLServerCentral.com | Category: round
Rating: (not yet rated) |  Discuss |   Briefcase | 203 reads

Date Dimension Script

T-SQL script that creates Date_Dim & populates it for any date-range.  Read more...
By Dave Bunch 2017/05/08 | Source: SQLServerCentral.com | Category: data warehousing
Rating: |  Discuss |   Briefcase | 582 reads

Find function dependencies

Produces a list of functions and the objects that use them.  Read more...
By Andy Robertson 2017/05/09 | Source: SQLServerCentral.com | Category: function
Rating: |  Discuss |   Briefcase | 398 reads

Faster Backuphistory delete

A faster backup history cleanup proc than the built in MSDB proc   Read more...
By Doran Mackay 2017/05/10 | Source: SQLServerCentral.com | Category: backuphistory
Rating: (not yet rated) |  Discuss |   Briefcase | 256 reads

Fix Orphan Users for All databases - Fixed Collation Problem

Most comman scenario which we face on everyday basis is to fix the orphan database users at the database level. You need to go to each database and fix the orphan users at the each databases.  Read more...
By Sivakumar Mohan 2017/05/03 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 456 reads

Database Refresh Sync

Sync users and roles after restore/refresh  Read more...
By Jason Givens 2017/05/01 | Source: SQLServerCentral.com | Category: users
Rating: |  Discuss |   Briefcase | 620 reads

Quick and dirty script to ascertain datafile headroom

This is quick script to ascertain datafile headroom based on current size of the data in a file against the max size (which needs to be set for this to work!)  Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 293 reads

PowerShell 3rd Party tool Memory Alert

Keeps a memory leak under control until the bug fix is developed and applied. Short term band aid.  Read more...
By Edward Pochinski 2017/04/25 | Source: SQLServerCentral.com | Category: sql
Rating: |  Discuss |   Briefcase | 332 reads

PowerShell for Server/DB/Object level Permissions/Logins/Roles/Users

PowerShell to generate Server Level Permissions/Logins/Roles, Object/Database Level Permissions.  Read more...
Rating: |  Discuss |   Briefcase | 462 reads

Index Utilization Summary

This report shows all the Indexes on user defined table or view and how effectively they are being used in our project.  Read more...
By Devendra Thakur 2017/04/20 | Source: SQLServerCentral.com | Category: index
Rating: |  Discuss |   Briefcase | 660 reads

Find and Replace a value across all tables in database

End user has entered ‘goodmorning’ and ‘good morning’ interchangeably and it was causing logic failure at application level. So task was to replace ‘goodmorning’ with ‘good morning’ in database wherever it is there.  Read more...
By Devendra Thakur 2017/04/28 | Source: SQLServerCentral.com | Category: search database
Rating: |  Discuss |   Briefcase | 601 reads

Change Column datatype

This script is for converting Char to nChar and varchar to nVarchar with the same length. This process has reduced the manual work by 80% (approximately) in our case.  Read more...
By Devendra Thakur 2017/04/24 | Source: SQLServerCentral.com | Category: alter table
Rating: |  Discuss |   Briefcase | 402 reads

Table Valued Function to factorize numbers up to 100 trillion

This table valued function will quickly find the prime factors of any number up to 10 trillion  Read more...
By Jonathan Roberts 2017/04/26 | Source: SQLServerCentral.com | Category: prime numbers
Rating: (not yet rated) |  Discuss |   Briefcase | 268 reads

Table Valued Function to return a range of prime numbers

A fast table valued function to generate a list of prime numbers within the range specified by the parameters.  Read more...
By Jonathan Roberts 2017/04/12 | Source: SQLServerCentral.com | Category: tally table
Rating: |  Discuss |   Briefcase | 312 reads

Remove SQL Comments

This function takes in SQL code and returns the same SQL code but with any comments removed (i.e. "/**/", "--")  Read more...
By Jordan Ryder 2017/04/13 | Source: SQLServerCentral.com | Category: sql
Rating: |  Discuss |   Briefcase | 544 reads

Truncate a table that has foreign keys referencing its columns

This stored procedure will truncate a table even when other tables have FKs referencing columns in it. It drops the Fks, truncates the table, re-creates the FKs  Read more...
By Jonathan Roberts 2017/04/14 | Source: SQLServerCentral.com | Category: truncate table
Rating: |  Discuss |   Briefcase | 532 reads

Rename Database

Programmatically rename a database.  Read more...
By Darren Thompson 2017/04/17 | Source: SQLServerCentral.com | Category: renaming
Rating: |  Discuss |   Briefcase | 338 reads
<< Newer    Items 21 to 40 of 3452    Older >>