Scripts

Technical Article

Compare the data of 2 Tables (Updated)

The SP compares the data in 2 tables and reports the different data. Tables could be from different servers, different databases or different schemas. This accepts 7 parameters 1, 2: Name of the 2 tables 3 : List only the differences 4. : Compare only the structure 5. : Check timestamp fields too 6. : […]

5 (1)

You rated this post out of 5. Change rating

2002-08-17

1,381 reads

Technical Article

Constraint Generator

This script can be used for generating the sql script for the constraints available on a particular table. There is a provision to generate script if the specified field(s) are part of the constraint.While specifing the field name , delimit them with ';'. Usage is ;Use pubs-- for generating the script for the tableexec Pre_Porting […]

You rated this post out of 5. Change rating

2002-08-16

432 reads

Technical Article

Script to create a standby database server(new).

New feature to relocate files on the secondary server has been added to this script. If you don't need this feature please use my other script that is posted on this website.Run this script on a secondary SQL Server to replicate the data of all the user databases from the primary server every 15 minutes. […]

You rated this post out of 5. Change rating

2002-08-09

290 reads

Technical Article

Script to montior ErrorLogs every 3 hours.

This script monitors your errorlogs every 3 hours for the past 3 hours. It notifies you by email for all types of errors and by pager for all critical errors with severity type > 16. Saves lot of time when you have to monitor several servers every day 24x7. Run this script on a dedicated […]

1 (1)

You rated this post out of 5. Change rating

2002-08-09

1,187 reads

Technical Article

Smart Index Manipulation system

We are constantly having to drop indexesfrom tables while repopulating the datain the table. We then have to rebuild the indexes as they were before dropping them.This requires writing a custom drop and recreate index script for each unique situation. If we tryto write scripts ahead of time as soon as the indexing schemechanges on […]

You rated this post out of 5. Change rating

2002-08-06

949 reads

Technical Article

Change DTS package owner

There is a un-documented stored procedure in msdb called sp_reassign_dtspackageowner. Unfortunately, this requires a package name and will only work on one at a time.  If one developer is taking over for another, it may be helpful to change all of Bob's dts packages over to Jim.   The following procedure will do just that.Not sure […]

5 (1)

You rated this post out of 5. Change rating

2002-08-05

449 reads

Technical Article

Retrieve every n values

this scripts presents the way to retrieve from a given result set the values given n where n determines that the Nth value,2N th values , 3Nth value will be returnedin the example n = 3 the returning rows are 22,32,42the given set is 20,21,22,30,31,32,40,41,42

You rated this post out of 5. Change rating

2002-08-01

433 reads

Blogs

Learning Database Design and Power BI Performance

By

I spend my days working on and managing SQL Server instances—working days at least,...

Free SQL Training: Dive into Databases This December!

By

Want to learn SQL and get some real practice this December? Check out the...

Monday Monitor Tips: CIS Compliant

By

A new feature added to Redgate Monitor Enterprise automatically. CIS compliance is something many...

Read the latest Blogs

Forums

SQL Server 2005 service fails to start

By iluminadajung

Hello, I’ve been trying to install Ms SQL Server 2005 for over two weeks...

How to Repair Corrupt MySQL Tables

By Nisarg Upadhyay

Comments posted to this topic are about the item How to Repair Corrupt MySQL...

The Funny Dynamic SQL

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Funny Dynamic SQL

Visit the forum

Question of the Day

The Funny Dynamic SQL

What happens when I run this code:

EXEC sp_executesql N'PRINT 1; GO';

See possible answers