1. Open "SQL scripts View", 1
Figure 1. Open the SQL Script View
2
, Create a connection, assuming"Masterconnection", According to the figure2And Graph3Set the connection attributes.
Figure 2 establish a connection
Figure 3 set connection attributes
3In theMasterconnection", CreateScript, Attribute settings4,ScriptThe content is as follows:
1 Use Master
2
3 If Not Exists ( Select *
4
5 From Master. DBO. sysdatabases
6
7 Where Name = ' Relaybookkeeping ' )
8
9 Create Database ' Relaybookkeeping '
10
11 Go
12
Note:RelaybookkeepingIs the database we need to create.
Figure 4CreateScript
4, New Connection"Relaybookkeepingconnection", According to the figure5SetGeneralAttribute.RequirementsAttribute settings3.
Figure 5 set connection attributes
5In theRelaybookkeepingconnectionCreate your own database script.6.
Figure 6 add your own database script
6, UninstallProgramDelete the database.
Procedure1,2,3. Create a connection,GeneralOn the properties page, set the database nameMaster. Then addScriptFile,RuntimeWhen the property is set to uninstall, the content is:
Use master
drop database relaybookkeeping
go
http://www.cnblogs.com/zhangleixp/archive/2006/11/11/installshielddatabase.html