SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 Article: Comparing Tables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 01/07/2002 :  01:02:51  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
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

USA
3246 Posts

Posted - 01/07/2002 :  16:40:39  Show Profile  Visit AjarnMark's Homepage  Reply with Quote
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

USA
4137 Posts

Posted - 01/07/2002 :  17:01:09  Show Profile  Visit graz's Homepage  Reply with Quote
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!

Australia
4970 Posts

Posted - 01/07/2002 :  17:13:10  Show Profile  Visit Merkin's Homepage  Reply with Quote
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

USA
1421 Posts

Posted - 01/07/2002 :  17:21:32  Show Profile  Visit mfemenel's Homepage  Reply with Quote
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

USA
3246 Posts

Posted - 01/07/2002 :  17:25:32  Show Profile  Visit AjarnMark's Homepage  Reply with Quote
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

USA
102 Posts

Posted - 01/07/2002 :  18:58:02  Show Profile  Visit GreatInca's Homepage  Send GreatInca an AOL message  Send GreatInca a Yahoo! Message  Reply with Quote
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!

Australia
4970 Posts

Posted - 01/07/2002 :  19:05:24  Show Profile  Visit Merkin's Homepage  Reply with Quote
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 - 03/05/2002 :  11:12:08  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000