473,320 Members | 1,957 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,320 software developers and data experts.

Database Compare Application help needed

I have to write a .Net application which can compare SQL Databases including
things like: -
DB structure, PK's, FK's,
indexes and types of indexes i.e. should be able to detect if the same index
has cascade set on one db and not on another, or unique on one and not the
other,
Constraints, Triggers, Stored procs, Users, Roles.
I downloaded the SQL Data Compare 3.0 application 14 day trial and it seemed
really good however does a bit more than I am required and I have to design
an application tailored to my businesses needs. At present there is a system
in VB.6.0 but I have to design a C#.net application using the latest SQL
objects available to do this. I was wondering if anyone could point me in
the direction of any source code/ solutions I could look at for .net which
allow me to compare databases. Or if anyone had any help and could point me
in the right direction I would be very greatful. Thank you very much. Even
if anyone know what objects are available in .net to compare databases I
would be very grateful
Jul 21 '05 #1
3 2044
Hey Stephen,

One option may be more to use C# as a reporting tool in the sense that most
of the work should be done within SQL Server. For exampley, you might
create a linked server within one SQL Server that points to the master
database of the one you wish to compare to. With this link defined, you
could then run queries comparing the two tables essentially as though they
are both right there.

You'd probably want these queries bundled into one or (likely) more stored
procedures that could then be called from a .NET app. I would envision then
returning rowsets of the differences. On the C# side, I'm sort of
envisioning a list of the comparisons that exist, allowing a user to maybe
select which to run then calling the corresponding stored procedure and
placing the results in a datagrid.

That's kind of a basic glossing over, but it sounded to me like you were
more focused on doing the work on the C# side, whereas comparing structured
data is one of the cores of an RDBMS.

HTH,

John
"Stephen" <St*****@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
I have to write a .Net application which can compare SQL Databases including things like: -
DB structure, PK's, FK's,
indexes and types of indexes i.e. should be able to detect if the same index has cascade set on one db and not on another, or unique on one and not the
other,
Constraints, Triggers, Stored procs, Users, Roles.
I downloaded the SQL Data Compare 3.0 application 14 day trial and it seemed really good however does a bit more than I am required and I have to design an application tailored to my businesses needs. At present there is a system in VB.6.0 but I have to design a C#.net application using the latest SQL
objects available to do this. I was wondering if anyone could point me in
the direction of any source code/ solutions I could look at for .net which
allow me to compare databases. Or if anyone had any help and could point me in the right direction I would be very greatful. Thank you very much. Even if anyone know what objects are available in .net to compare databases I
would be very grateful

Jul 21 '05 #2
Hello Stephen,

I do not know what open source libraries exist. I trust you can google for
yourself and see.
I did stumble across this older sample app:
http://www.c-sharpcorner.com/databas...e_explorer.asp

There's no objects in the framework, that I've been able to find, that are
particularly good for the kind of comparisons you want. Sure, the DataSet
contains definitions of rows and columns, but it doesn't help you find
foreign keys, or stored proc dependencies, and the like.

If all your databases are SQL Server, and your app will run on the SQL
Server machine with the highest version number (in other words, if you are
comparing SQL Server 2000 with SQL Server 7.0, you'd need to run your app on
the SQL 2000 box)... if all that is true, you can use SQL-DMO. These are
COM components that provide a complete object heirarchy for structural
comparisons, scripting, and database manipulation. (The Enterprise Manager
uses SQL DMO to actually perform it's work, so if it can be done with EM,
you can do it with SQL-DMO).

If any DB is not SQL Server, then you are out of luck with DMO. Also, DMO
is not useful to run from a client, since it is not legal to install it
there.

If you need to compare from a client app, then you will need to inspect the
SQL Server system tables themselves. Unlike John, I do believe you should
do this work in C#. Since you are comparing two databases, there is no
guarantee that the databases can, or should, talk to each other, setting up
a linked db may not be a viable solution. Even if it is viable, it is not
likely to be something you'd be allowed to do in an evironment where
security matters even a little bit. (You should meet some of the data
security folks where I work! These guys mean business. They audit
everything and they have the power to shut off any app that doesn't abide by
the rules.)

There are probably books and online tutorials that will tell you how to make
sense of the system tables... I can't help much there. I know that some of
it can be gleaned from SQL Books Online.

Hope this helps,
--- Nick

"Stephen" <St*****@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
I have to write a .Net application which can compare SQL Databases including things like: -
DB structure, PK's, FK's,
indexes and types of indexes i.e. should be able to detect if the same index has cascade set on one db and not on another, or unique on one and not the
other,
Constraints, Triggers, Stored procs, Users, Roles.
I downloaded the SQL Data Compare 3.0 application 14 day trial and it seemed really good however does a bit more than I am required and I have to design an application tailored to my businesses needs. At present there is a system in VB.6.0 but I have to design a C#.net application using the latest SQL
objects available to do this. I was wondering if anyone could point me in
the direction of any source code/ solutions I could look at for .net which
allow me to compare databases. Or if anyone had any help and could point me in the right direction I would be very greatful. Thank you very much. Even if anyone know what objects are available in .net to compare databases I
would be very grateful

Jul 21 '05 #3
Nick makes an excellent point on security. You'll definitely need to
consider such things.

My history has been (and this is meant to give an idea of where the
suggestion came from than because I think you want to know my life story
from DNA thru this afternoon) in smaller shops where such operations are
generally done within a company umbrella where one department shares
another's data freely. If it gives you an idea of "small shop", currently,
I AM the "security guys" <g>.

Also, having "grown up" in dBase dialects, where language and data are more
closely tied, I'm probably more skewed towards doing the anaylsis directly
from stored data than may be considered best practice in an n-tier world.

"Stephen" <St*****@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
I have to write a .Net application which can compare SQL Databases including things like: -
DB structure, PK's, FK's,
indexes and types of indexes i.e. should be able to detect if the same index has cascade set on one db and not on another, or unique on one and not the
other,
Constraints, Triggers, Stored procs, Users, Roles.
I downloaded the SQL Data Compare 3.0 application 14 day trial and it seemed really good however does a bit more than I am required and I have to design an application tailored to my businesses needs. At present there is a system in VB.6.0 but I have to design a C#.net application using the latest SQL
objects available to do this. I was wondering if anyone could point me in
the direction of any source code/ solutions I could look at for .net which
allow me to compare databases. Or if anyone had any help and could point me in the right direction I would be very greatful. Thank you very much. Even if anyone know what objects are available in .net to compare databases I
would be very grateful

Jul 21 '05 #4

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

Similar topics

5
by: democratix | last post by:
Hi, I've only got a couple years experience developing for Access but have recently been experimenting with HTML/javascript for gui and client-side scripting, mysql for database and php for...
1
by: Frank Maestas | last post by:
Hello, I have a company MySQL database containing e-mail addresses. Some of these addresses are bad. I have a text file with the addresses I need to remove from the MySQL database. Is there a...
20
by: xixi | last post by:
hi, we use db2 udb v8.1 on windows, i am trying to use federated database objects to create wrapper, even though i have update dbm cfg using federated yes, i still get error "the instance for the...
7
by: TJoker .NET | last post by:
I'm developing an VB.NET Windows Forms application that uses CR for VS.NET (original version shipped with VS.NET 2002 - my VS.NET has the latest SP installed, no SPs for CR). My reports get their...
3
by: Stephen | last post by:
I have to write a .Net application which can compare SQL Databases including things like: - DB structure, PK's, FK's, indexes and types of indexes i.e. should be able to detect if the same index...
3
by: Benny Ng | last post by:
Dear all, The following is the source. The password is encrypted and saved into the Binary in SQL2K. Now I want to create a new page to compare the existed password and the password that in the...
10
by: Jim Devenish | last post by:
I have a split front end/back end system. However I create a number of local tables to carry out certain operations. There is a tendency for the front end to bloat so I have set 'compact on...
0
by: Jack | last post by:
Training Classes for Oracle10g, 9i, 8i Certification training in Oracle10g and 9i: DBA, Developer, Discoverer. training conducted at your location worldwide. Courseware licensing also available....
0
by: Winder | last post by:
Training Classes for Oracle10g, 9i, 8i Certification training in Oracle10g and 9i: DBA, Developer, Discoverer. training conducted at your location worldwide. Courseware licensing also available....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.