Building and Deploying

The final item we haven’t covered is the actual act of updating a schema in a database with the schema in a database project. You use the familiar build-and-deploy paradigm leveraged by other Visual Studio project types. In the context of a database project, the build process parses all the SQL files and identifies any files that have SQL syntax errors. If the build is clean, you can now publish the database by right-clicking the project within Solution Explorer and selecting Publish (see Figure 13.28). This actually updates the target database with the schema (or creates a new database if the target database doesn’t exist).

Image

FIGURE 13.28 Publishing a database.


Note

You don’t have to use Visual Studio to do the actual schema deployment to the server. By building the database project, you are generating a SQL script file with all the necessary SQL commands. You can execute that script file from within any tool that understands T-SQL (including SQL Server Management Studio itself). This is useful when the actual schema change is implemented by someone in the DBA role, who might or might not have Visual Studio installed, or who might have a specific tool that he is required to use for schema propagation.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset