Red Gate forums :: View topic - How can I capture the sqlcompare output into a DB table?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

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

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
mishaluba



Joined: 26 Dec 2012
Posts: 5

PostPosted: Wed Mar 20, 2013 10:28 pm    Post subject: How can I capture the sqlcompare output into a DB table? Reply with quote

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] >>
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6641

PostPosted: Mon Mar 25, 2013 12:02 pm    Post subject: Reply with quote

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_Compare_report_XML_import

Hope this helps!
Back to top
View user's profile Send private message
mishaluba



Joined: 26 Dec 2012
Posts: 5

PostPosted: Tue Mar 26, 2013 5:49 am    Post subject: Re: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group