How to: Include Custom Scripts with a Database in a Web Package
This page is specific to:.NET Framework Version:4.0
How to: Include Custom Scripts with a Database in a Web Package

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

You can include SQL Server database scripts when you want to include a SQL Server database in a Web package. You can also set the order that the scripts are executed when the database is recreated on the server when the Web package is deployed. For more information about including a database together with a Web package, see Deploying Databases with Web Application Projects Overview.

Adding a SQL Server Script to a Web Package

The SQL scripts run in the order that you set when you specify the scripts in the Publish - SQL tab of the Properties page.

Adding a database script to a Web package

  1. In Solution Explorer, double-click Properties.

  2. On the Properties page, select the Publish - SQL tab.

  3. If you have already included a database to the Web package, select the Connection Name you entered previously. If you have not included a database in the Web package, click Add Data Connection and enter the database connection information. For more information about how to add a database, see Walkthrough: Deploying a Database with a Web Package.

  4. In the Source Scripts section, click Add Script.

  5. From the Select File dialog box, select a script to add and click Open. You can add scripts by repeating steps 4 and 5.

  6. You can use the arrow buttons on the right of the Source Scripts table to change the order of when the scripts run. Select a script from the table and click the up or down arrows to move the script file higher or lower in the order.

  7. If you do not want to include a script, clear the Include check box for that script.

  8. From the File menu, select Save All to save the scripts information.

See Also

Concepts

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View