Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 Article Discussion
 Article: Comparing Tables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-07 : 01:02:51
We are in the process of rolling out a new version of a SQL Server-based software package at work. I already have numerous scripts that load tables and I was trying to find out which ones would break. I needed an easy way to compare tables. There are some packages out there that do this but budgets are kind of tight where I work right now. And since I thought it would make a good article I decided to write my own.

Article Link.

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-01-07 : 16:40:39
Graz, nice work! We are getting ready to move to SQL2K and I can't wait to try this out. (SQL 7 doesn't do user-defined functions ).

A question on the script... There are a couple places where you have this:

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


Is that just a leftover from merging multiple scripts, or is there some functional reason for that series I'm not aware of?

--------------------------------------------------------------
1000 Posts, Here I come! I wonder what my new title will be...
Go to Top of Page

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2002-01-07 : 17:01:09
That's left over from using Enterprise Manager to generate the scripts for the objects No other reason beyond that.

===============================================
Creating tomorrow's legacy systems today.
One crisis at a time.
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-01-07 : 17:13:10
It's good to keep the SET command working like that.
Other it gets all jammed up and stuck. You need to keep it all moving and loosened up, then you need a can of WD40 or something to unjam it.



Damian
Go to Top of Page

mfemenel
Professor Frink

1421 Posts

Posted - 2002-01-07 : 17:21:32
Merkin The Dimented Yak

Mike
"A program is a device used to convert data into error messages."
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-01-07 : 17:25:32
quote:

Merkin The Dimented Yak



Yeah, he's just gunning for 1400 before I hit 1000.

--------------------------------------------------------------
1000 Posts, Here I come! I wonder what my new title will be...
Go to Top of Page

GreatInca
Posting Yak Master

102 Posts

Posted - 2002-01-07 : 18:58:02
How about everying else? Particularly indexes (w/ column order and properties), FKs (w/ columns & properties), Primary/Unique Key (same thing), and all them default constraints everywhere (I made most of them).

Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-01-07 : 19:05:24
Once it got to that level of complexity you might be better off buying one of the tools that does this.

Unless you feel like adding the functionality into the script yourself ???



Damian
Go to Top of Page

Traber
Starting Member

2 Posts

Posted - 2002-03-05 : 11:12:08
I have aa low tech, low cost solution that I use all the time. I generate SQL scripts in Enterprise Manager, script all objects, include keys, constraints, indexes, etc, one file per object to a separate directories for the source and target. Go to http://www.fileware.com/ and get FileSync and FileDiff (only $15, well worth it, IMO). Point FileSync at the source and target directories and run a binary compare. It will show you every SQL object that is different in green. Try it and you'll like it too.
Go to Top of Page
   

- Advertisement -