How can I capture the sqlcompare output into a DB table?

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

How can I capture the sqlcompare output into a DB table?

Postby mishaluba » Wed Mar 20, 2013 10:28 pm

Hello,

I have a large number of customer databases, which are mostly the same, but occasianally some differences creep in. This could be a result of our support group fixing things for individual clients or some customizations. I would like to have visibility into which databases are different from \"standard\" and how. SQL Compare command line does a great job producing output similar to the one below, but now I would like [u]to capture and store this output in a database table [/u] so I can keep track of changes and do all sorts of cool stuff with it. Is there a painless way to do this or do I have to parse the output text file somehow?

Thank you!

Sample output:

Object type Name DB1 DB2
---------------------------------------------------
Table [dbo].[table1] >>
Table [dbo].[table234] <> <>
Table [dbo].[table999] <> <>
Table [dbo].[procedure123] >>
Table [dbo].[procedure543] >>
mishaluba
 
Posts: 5
Joined: Wed Dec 26, 2012 7:38 pm

Postby Brian Donahue » Mon Mar 25, 2013 12:02 pm

I'm not sure this is the best solution, but what I did was to create a comparison report as XML, then introduce an XML schema collection into a database using the definition of the XML comparison report and create a table to hold the reports. You would then need to query the database using SQLXML XPATH queries.

http://sdk.red-gate.com/index.php/SQL_C ... XML_import

Hope this helps!
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am

Re:

Postby mishaluba » Tue Mar 26, 2013 5:49 am

Thank you, Brian! This is very helpful and good to know. I ended up going with a different approach. I specify output of sqlcompare to be an Excel file and then programmatically open this Excel and save it as CSV (because Excel is notoriously hard to work with in SSIS). From then on it's pretty easy to load into a database table using SSIS flat file connection manager.
mishaluba
 
Posts: 5
Joined: Wed Dec 26, 2012 7:38 pm


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests