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 3000    Older >>
 

Enable and configure DB mail using T-SQL

Use this to enable and setup database mail in sql server 2005/2008  Read more...
By Patrick Akhamie 2014/06/24 | Source: SQLServerCentral.com | Category: dbmail
Rating: |  Discuss |   Briefcase | 975 reads

Script to Detach All User Databases

The script will automatically detach all databases. Please run sp_helpdb to find out the location of all data and log files before using the script.  Read more...
By Patrick Akhamie 2014/06/26 | Source: SQLServerCentral.com | Category: detach database
Rating: (not yet rated) |  Discuss |   Briefcase | 614 reads

Find SQL Server Install Date

This is handy script which could be used to find the SQL Instance install date.   Read more...
By Patrick Akhamie 2014/07/10 | Source: SQLServerCentral.com | Category: documentation
Rating: |  Discuss |   Briefcase | 912 reads

Fix orphaned users after restoring database to another server

Find and fix orphan users after doing a database restore. It uses cursors but they are pretty minimally intrusive.  Read more...
By Patrick Akhamie 2014/07/17 | Source: SQLServerCentral.com | Category: orphan users
Rating: |  Discuss |   Briefcase | 1,253 reads

Replication Monitor Script

The script shows great detail about the topoogy of replication as well as the status and undistributed commands as well as other neat details about the architecture of the replication including all publications and subscriptions.  Read more...
By Patrick Akhamie 2014/07/03 | Source: SQLServerCentral.com | Category: replication
Rating: (not yet rated) |  Discuss |   Briefcase | 709 reads

List all the fields of a table with its properties + PK

This script returns a list of all the fields of a table with it properties, primary keys and user defined types.  Read more...
By Joan Magnet 2014/05/23 | Source: SQLServerCentral.com | Category: table fields definition
Rating: |  Discuss |   Briefcase | 1,162 reads

script to find mirrored databases on principal or mirrored instance

The script helps you find out what databases are mirrored, their state, the partner instance and the enpoint port. Part two shows the endpoint details.  Read more...
By Patrick Akhamie 2014/05/22 | Source: SQLServerCentral.com | Category: monitor mirroring
Rating: (not yet rated) |  Discuss |   Briefcase | 438 reads

Collecting SQL Server 2000/2005/2008 baseline

Script to get Server Info Collecting SQL Server 2000/2005/2008 baseline inventory  Read more...
Rating: |  Discuss |   Briefcase | 1,304 reads

SQL Battleship

It's you versus the computer in the classic game of Battleship, completely playable from the SQL Server Management Studio interface!  Read more...
By Sean Smith 2014/05/26 | Source: SQLServerCentral.com | Category: ai
Rating: |  Discuss |   Briefcase | 1,649 reads

Hassle free parameters in dynamic sql.

An alternative solution to passing parameters to sp_executesql.  Read more...
Rating: |  Discuss |   Briefcase | 1,420 reads

Compare two tables for structure and layout

Compare the structure/layout of two tables within an instance of SQL Server (version 2012) and return non-matches.  Read more...
By Trevor Makoni 2014/05/16 | Source: SQLServerCentral.com | Category: compare
Rating: |  Discuss |   Briefcase | 1,477 reads

buffer_memory_mgt

If you ever need to find out what database is using up the most buffer pool resource, this will help. You will also get the object in the buffer for the specific database that is using up the most buffer resource. It will help when troubleshooting buffer related issues.  Read more...
By Patrick Akhamie 2014/05/14 | Source: SQLServerCentral.com | Category: buffer mgt
Rating: |  Discuss |   Briefcase | 732 reads

Find Average Page Life Expectancy

I have a brief note in the query header itself  Read more...
By Patrick Akhamie 2014/05/13 | Source: SQLServerCentral.com | Category: ple
Rating: |  Discuss |   Briefcase | 739 reads

Create notifications for failed jobs with one easy script

Here an easy way to setup alerts for all sql agent jobs. Typically I use this to send an email alert when a job fails. I always setup a group email address rather than individuals to make this a one-time setup.  Read more...
By Patrick Akhamie 2014/05/12 | Source: SQLServerCentral.com | Category: sql agent
Rating: |  Discuss |   Briefcase | 1,408 reads

Get database size, used space, free space

Gets the size, amount of space used & unused, owner and modify date for all databases in a Sql instance.  Read more...
By Trevor Makoni 2014/05/09 | Source: SQLServerCentral.com | Category: file size
Rating: |  Discuss |   Briefcase | 1,280 reads

vlfs_Count_for_Each_Database

Here is a short code to count the VLFs in the transaction log for each database in the instance.  Read more...
By Patrick Akhamie 2014/05/06 | Source: SQLServerCentral.com | Category: transaction_log
Rating: |  Discuss |   Briefcase | 932 reads

Find database where table is located

Return a list of databases which contain a table from wildcard table name.  Read more...
By Trevor Makoni 2014/05/05 | Source: SQLServerCentral.com | Category: find
Rating: |  Discuss |   Briefcase | 945 reads

Size of database files for an instance of SQL Server

Size of database files for an instance of SQL Server  Read more...
By Andrés Michaca 2014/05/07 | Source: SQLServerCentral.com | Category: file size
Rating: |  Discuss |   Briefcase | 940 reads

Generated script to update statistics

Generated script to update statistics  Read more...
By Andrés Michaca 2014/05/02 | Source: SQLServerCentral.com | Category: statistics
Rating: |  Discuss |   Briefcase | 1,227 reads

Reorganize indexes

Generate script to reorganize indexes in a database  Read more...
By Andrés Michaca 2014/05/01 | Source: SQLServerCentral.com | Category: indexing
Rating: |  Discuss |   Briefcase | 1,063 reads
<< Newer    Items 41 to 60 of 3000    Older >>