468,505 Members | 1,605 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,505 developers. It's quick & easy.

SQLDMO Compare DB help needed please

I am trying to compare the tables in two similar databases using the SQLDMO
object. I am able to use this object to access different SQL servers and
choose two different databases. The versions of the databases are slightly
different so I would like to be able to compare them for things like
datatypes, primary and foreign keys, number of records etc. I know that
there are packages out there that do this kind of thing but I have to
complete this task myself in house. Would anyone have any code doing this
kind of thing or could anyone point me in the direction of help in terms of
which specific objects I should be using to complete the task I have set??
Thanks for any help you can give me
Nov 16 '05 #1
1 1628
Stephen,

You could use SQLDMO for this, but you might have a much easier time
issuing statements against each db and comparing the structures that way.
Basically, you can query for the structure of the table, query for the
primary key information, etc, etc, and you can get it in two tables (and
then comparing the values in the two tables is much easier than comparing
object trees which are disparate).

If you do this, you are going to be looking at the sysobjects,
sysindexes, and sysindexkeys table primarily.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Stephen" <St*****@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
I am trying to compare the tables in two similar databases using the SQLDMO
object. I am able to use this object to access different SQL servers and
choose two different databases. The versions of the databases are
slightly
different so I would like to be able to compare them for things like
datatypes, primary and foreign keys, number of records etc. I know that
there are packages out there that do this kind of thing but I have to
complete this task myself in house. Would anyone have any code doing this
kind of thing or could anyone point me in the direction of help in terms
of
which specific objects I should be using to complete the task I have set??
Thanks for any help you can give me

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by silven | last post: by
2 posts views Thread by Stephen | last post: by
1 post views Thread by Mohammed Abdel-Razzak | last post: by
3 posts views Thread by T. | last post: by
1 post views Thread by | last post: by
3 posts views Thread by Dean L. Howen | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.