473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

SQLDMO object help needed please

I am trying to compare the tables in two similar environments 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 22 '05 #1
2 1426
A good article to start with is here:
http://www.sqljunkies.com/Tutorial/1...CA1D8C97D.scuk

Use the object browser to scan through the tree of objects.

Basically, once you connect to a server, you get access to the .Databases
collection. Find the database that you are interested in by name (as
illustrated in the example) or just scan the collection and get the name of
each database. Once inside a database, open the Tables collection and find
the table of interest.
Once you have found the table, you can compare columns, datatypes,
dependencies, etc using the object model, or you can script the whole thing
to ASCII and compare the output.

Another good article, that examines DMO from the underlying technology is:
http://www.expresscomputeronline.com...chspace1.shtml

A much older article, but still useful, is:
http://www.ftponline.com/vsm/2001_12...efault_pf.aspx

Be aware that SQL Server Yukon is replacing SQL DMO with SQL Management
Objects, a native .NET object model that is somewhat dissimilar to SQL DMO.
I do not know if SQL DMO will be compatible with SMO (it probably is), but I
suspect that SQL DMO will not ship natively with Yukon. In that case, your
app may not run if the server that you are running it on doesn't have SQL
Server 2000 installed.

Good Luck,
--- Nick

"Stephen" <St*****@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...
I am trying to compare the tables in two similar environments 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 22 '05 #2
I retract one of my statements... apparently SQL DMO will ship with Yukon.

--- Nick

"Stephen" <St*****@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...
I am trying to compare the tables in two similar environments 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 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ewm | last post by:
Using InstallShield Developer 7.04. Does anyone know of a good way to detect if SQLDMO is installed? TIA mcpoo
2
by: Stephen | last post by:
I am trying to compare the tables in two similar environments using the SQLDMO object. I am able to use this object to access different SQL servers and choose two different databases. The versions...
1
by: Mohammed Abdel-Razzak | last post by:
Dear sirs I`ve used SQLDMO to make a backup to my database How can I use it to restore database? thanks Mohammed
3
by: T. | last post by:
I dumped VB and adopted C# for this version of Visual Studio. My problem! I am trying to reference an SQLDMO.Database object in C# like so: private SQLDMO.Database dbcurrent; private string...
1
by: Stephen | last post by:
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...
1
by: | last post by:
Hi all My requirement is to "on button_click, backup a SQL database using SQLDMO.Backup object and update the progress in a ProgressBar. The problem is the progress bar does not update at all...
2
by: | last post by:
Hi all, continued from yesterday's posting... I still haven't found a solution to this issue. I put a breakpoint in private void SqlBackupPercentComplete(string message, int Percent) {...
1
by: | last post by:
Hi all I am posting this to check if anyone could help me. The problem still persists. I am beginner in C#. Thanks. Subject: SQLDMO.Backup and ProgressBar - help please From: ...
1
by: T. | last post by:
I have this code: foreach(SQLDMO.Database db in sqlsvr.Databases) dblist.Add(db.Name.ToString()); When I run this code I get an error "Object reference not set to an instance of an object"....
3
by: Dean L. Howen | last post by:
I tries to search for SQL server using SQLDMO, but it alway return null although I have updated SQL to sp3 Please tell me more.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.