What happens when I want to refresh the schema in a Team Edition for Database Professionals database project? Say I've created a project, imported a database schema, and then I make some changes using SQL Server Management Studio. How do I get my updates into my database project?
There are a couple ways to accomplish this. This post describes one method.
First I create a database project named Test1:
Once created the project shows up in Solution Explorer:
I right-click on the project name (Test1) and click Import Database Schema:
I configure the import dialog as shown:
After I click Finish, the import process fires:
After import completes, I note the warnings and click the Finish button. When I right-click on the project name (Test1) in Solution Explorer, my context-sensitive menu has changed. To proceed with the demonstration, click Unload Project:
Once the project is unloaded, Solution Explorer now contains only the project file. I right-click the project and click Edit Test1.dbproj:
The xml containing the project definition opens in the IDE editor (There are always risks when editing xml project definitions, so be careful. It's a god idea to make a backup before editing begins.):
If I collapse all but the last tag (the tag that contains the schema definitions), I can easily highlight this information:
Once deleted, I save the file and close it:
Right-click the project name in Solution Explorer and select Reload Project:
If I forgot to close the file earlier, I will receive this prompt:
When the project reloads, the schema is empty:
A right-click on the project name in Solution Explorer brings up the earlier menu, allowing me to import the schema:
There are always risks when editing xml project definitions, so be careful. It's a god idea to make a backup before editing begins.
Technorati Tags: Data Dude Team EDition for Database Professionals Import Re-import refresh schema