Database schema compare options in Visual Studio 2

2020-07-03 07:36发布

问题:

I'm just in the middle of migrating my solutions from Visual Studio 2010 to Visual Studio 2013.

I have this (maybe) silly problem with database comparisons options. I would like to exclude certain object types from comparison globally so that I don't have to do this every time. In Visual Studio 2010 those options were available in Tools -> Options -> Database Tools -> Schema Compare.

I cannot find anything corresponding in Visual Studio 2013.

回答1:

There isn't a corresponding option with the SSDT framework (what replaced DB Projects). The best you can do is save your schema compare, then include it in the project. (It doesn't get included by default, even though the file itself is saved.) That will save your options so you can easily get them back. Not as convenient in some ways, but it does work. I miss being able to set the defaults as well.



回答2:

Just to be clear (in case others are looking for it), the Schema Compare feature is now available for VS2013. Right-click your database project and choose "Schema Compare". Then, as Peter mentioned, you can save it and include it in your project. Not sure why it is not included by default.



回答3:

Just a note that in VS2013 (Premium), you can access the tool to schema compare two databases on your network from Tools-SQL Server-New Schema Compare. No need for a project.

I went through some searching which referred to a Data menu item, which was present in earlier VS versions but not in VS2013. So hopefully this can save people some time if using VS2013



回答4:

Direct to the point:

Go to a solution > Add New Project > "SQL Server Database Project".

Now right click the project and select SCHEMA COMPARE...



回答5:

on the top of each of your *.scmp file window, there is an 'options' icon. click that.



回答6:

In VS2013 you can get rid of that on project basis, in the SQL -> Options -> Object Types, you can exclude some objects for the current Database Project.