Question

I've discovered that in Visual Studio 2010 Professional it is possible to refresh the database for a SQL Server Database Project (This feature is normally only available to the Premium and Ultimate versions). All you need to do is delete all the SQL files from the "Schema Objects" folder (but leave the folder structure intact) and the "Database.sqlpermissions" file. Then the "Import Database Objects and Settings..." option will become enabled, allowing you to refresh the database project with the latest schema.

I would like to write a macro for Visual Studio 2010 that can do this.

The macro should...

  • Delete every .SQL file (or every file) in the "Schema Objects" folder and it's child folders, but do not delete the folders from the project. The files must be deleted AND removed from the project.
  • Delete the file "Properties\Database.sqlpermissions". The file must be deleted AND removed from the project.

Any tips on writing macros in Visual Studio will help me. Thanks.

Was it helpful?

Solution 2

information on writing visual studio macros is located here...

http://msdn.microsoft.com/en-us/library/b4c73967(v=vs.80).aspx

OTHER TIPS

You can refresh the model in the database project without deleting everything. Simply sync the model from the target database.

Right-click 'Schema comparisons', add a new schema compare (if you don't already have one). When you have created it, Double-click to run it. It will compare the source and target, and create a list of any differences. You can review and eliminate any chnages you do not want synchronising, then click 'Write Updates' to apply. [I don't have a Professional version installed to check if this is the same, but you would hope so!]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top