1

I am trying to automate our build process. Until now I was able to create the code packages using CruiseControl.net, nAnt and MSBuild. But I am completely stuck when it comes to database comparing. I want to compare the development database to our QA database and create a script with the changes. I currently use the VS2010 database project and I could compare them manually. Is there any way I can make this comparison automatic? If I deploy my project, I get an .sql file generated using the dev database, but it is the whole database. I would like to have the differences between dev and qa only.

Is there any way to perform this approach? Any tool that allow me to compare the schema and run it from msbuild or the command line.

Thanks!

JSBach
  • 4,375
  • 7
  • 43
  • 90
  • possible duplicate of [What is best tool to compare two SQL Server databases (schema and data)?](http://stackoverflow.com/questions/685053/what-is-best-tool-to-compare-two-sql-server-databases-schema-and-data) Although product recommendations are usually off-topic on SO. – Pondlife Jun 06 '13 at 20:28
  • @Pondlife sorry, maybe my question is not abut what product to use, but any approach, msbuild task and so on. I will take a look into this question you pointed out. thanks! – JSBach Jun 06 '13 at 20:41
  • Do you want to compare differences in permissions, stored procedures, table definitions, table data, domain table data, what? I think the extent of the differences will matter quite a bit here. – tommy_o Jun 06 '13 at 23:13

2 Answers2

2

I've had a lot of luck with RedGate's SQLCompare product, and it comes with an SDK.

http://www.red-gate.com/supportcenter/Content?c=knowledgebase%5CSQL_Comparison_SDK%5CKB200801000220.htm&p=SQL%20Comparison%20SDK

Bill Gregg
  • 6,674
  • 1
  • 18
  • 33
  • 1
    In addition to RedGate's usual Compare tools, they are also building some new release management tools. I'm a very happy Red Gate customer. – Jamie F Jun 06 '13 at 20:29
  • Yes, but worth it. Your question said "any tool" so I took you at your word. Maybe you meant "any free tool"? – Bill Gregg Jun 06 '13 at 20:55
  • You are correct, "any tool" is desired. I was just confirming that it is not free (I checked the website and that was the impression I got). Of course free tools have some priority, but if none match my needs, a paid tool is, of course, possible. – JSBach Jun 07 '13 at 16:23
  • Oscar, I work for Red Gate and should be able to help you get up and running. Email me at David.Atkinson at red-gate.com and I'll point you to some useful resources. – David Atkinson Jun 07 '13 at 17:00
0

You can use xSQL Software's SQL Schema Compare command line utility to automate the process with very little effort. And, the tool is free for SQL Server Express.