473,472 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1427
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.