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

mishalubamishaluba Posts: 10
edited March 26, 2013 12:49AM in SQL Compare Previous Versions
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 to capture and store this output in a database table 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] >>

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    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!
  • 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.
Sign In or Register to comment.