Click here to monitor SSC
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

   Items 1 to 20 of 3273    Older >>
 

SQL Agent job to show SQL Server service details upon agent restart

To show SQL Server and physical server details upon instance restart so that we have visibility of unexpected issues with servers and services.  Read more...
By Haden Kingsland 2016/02/04 | Source: SQLServerCentral.com | Category: sql agent
Rating: (not yet rated) |  Discuss |   Briefcase | 34 reads

Enhanced Index Rebuild Script

Enhanced version of Index Rebuilt Script originally written by Michelle Ufford, which now includes latest version updates and additional features.  Read more...
By Haden Kingsland 2016/02/04 | Source: SQLServerCentral.com | Category: index rebuilds
Rating: (not yet rated) |  Discuss |   Briefcase | 68 reads

Grant EXECUTE on all user-defines types

Gives execute permission on all user-defined types for the specific user   Read more...
By rpalbert 2016/02/03 | Source: SQLServerCentral.com | Category: user-defined types
Rating: (not yet rated) |  Discuss |   Briefcase | 21 reads

Restore Redgate Transaction logs files via SQL

The script will restore the all the transaction logs files generated by Red Gate after extracting into .trn files.  Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 12 reads

Transfer/copy data between servers using Remote Connection

Synch tables from Server 1 to Server 2 with out dropping tables in server 2 which do not exists in server 1.  Read more...
By Surya Sunil Modekurthy 2016/02/01 | Source: SQLServerCentral.com | Category: replication
Rating: (not yet rated) |  Discuss |   Briefcase | 68 reads

Monday whatever the circumstances

The script returns Monday 00:00 regardless of the @@DATEFIRST  Read more...
By Peter Shilovich 2016/01/31 | Source: SQLServerCentral.com | Category: @@datefirst
Rating: (not yet rated) |  Discuss |   Briefcase

Data Merge Builder

Create a MERGE statement used to load/update data in a table.  Read more...
By Paul Hunter 2016/01/29 | Source: SQLServerCentral.com
Rating: (not yet rated) |  Discuss |   Briefcase | 57 reads

Design : Find table with Identities with missing unique constraints

In an OLTP DB, other than an autogenerated Identity , there should be something else on the table which makes the non-identity data unique, as in, unique if you had to drop the ID column.  Read more...
By Doran Mackay 2016/02/03 | Source: SQLServerCentral.com | Category: data quality
Rating: |  Discuss |   Briefcase | 375 reads

Index stats with key,included columns, size - all you can eat

Get total access,updates, rowlocks,pagelocks, stats date,rowcount for all tables or specific table by partition  Read more...
By Doran Mackay 2016/02/04 | Source: SQLServerCentral.com | Category: indexing
Rating: |  Discuss |   Briefcase | 637 reads

Generic SQL backup with Azure support

Generic SQL backup with Azure support allowing several, handy backup options.  Read more...
By Haden Kingsland 2016/01/29 | Source: SQLServerCentral.com | Category: backups
Rating: (not yet rated) |  Discuss |   Briefcase | 249 reads

Design : Find and script out Missing Foreign Keys

Find missing Foreign Keys by name, only reference single column primary keys which are on top of an identity,also find where column names reference table with column name ='ID'.  Read more...
By Doran Mackay 2016/02/01 | Source: SQLServerCentral.com | Category: integrity
Rating: |  Discuss |   Briefcase | 750 reads

Instance wide script to add user (the 4th way)

The script can be used to perform any task against all databases hosted on an instance. This is an example script that checks if a user is in a database if it is not then create the user and add it db_datareader role.   Read more...
Rating: |  Discuss |   Briefcase | 418 reads

usp_ERRORLOG_SIZE

Returns the size of the current SQL Server ERRORLOG file.  Read more...
Rating: |  Discuss |   Briefcase | 455 reads

History of the size of the database files

The DBA often needs to know when, how much and what kind of database file has changed its size. Also nice to know the amount of free space on the drive where the files are located databases.  Read more...
Rating: |  Discuss |   Briefcase | 1,240 reads

SQLPS Meets the DMV's

This is a great wrapper for your DMV's to automate a quick performance metric capture.  Read more...
By Edward Pochinski 2016/01/12 | Source: SQLServerCentral.com | Category: dmv
Rating: (not yet rated) |  Discuss |   Briefcase | 192 reads

Mirror Partner Agent Job To Auto Kick Back to Primary

Query the mirror instance via agent job to auto kick back to primary. If db is in suspended state will resume mirroring.  Read more...
By Ryan Loftin 2016/01/05 | Source: SQLServerCentral.com | Category: mirroring
Rating: |  Discuss |   Briefcase | 373 reads

Fix Orphan Users for Instance Migration

Use provided script to fix orphan users for all databases after Instance Migration. Tested on SQL 2014.  Read more...
By Ajay Dwivedi 2016/01/04 | Source: SQLServerCentral.com | Category: migration
Rating: |  Discuss |   Briefcase | 1,045 reads

Merry Christmas

A holiday decoration for you  Read more...
By Steve Jones 2015/12/25 | Source: SQLServerCentral.com
Rating: |  Discuss |   Briefcase | 1,398 reads

Failed and Successful Login Auditing Using xp_readerrorlog

Script uses undocumented extended stored procedure xp_readerrorlog to find failed logins (grouped) and last successful login  Read more...
By Ryan Loftin 2015/12/30 | Source: SQLServerCentral.com | Category: auditing
Rating: |  Discuss |   Briefcase | 774 reads

Know read and write ratio before you tune database performance

A script to get the user table query ratio and update radio,etc  Read more...
By Michael Zhang 2015/12/21 | Source: SQLServerCentral.com | Category: performance tuning
Rating: |  Discuss |   Briefcase | 1,407 reads
   Items 1 to 20 of 3273    Older >>