ArticleDirectory
- Creating a sample project that will create a SQL Server catalog by running customized SQL script
- Creating a sample project that will create an oracle catalog by running customized SQL script
I really don't want to turn it around, because since I can Google it, it's just a matter of doing so. I have to watch it myself. I can save my webpage or add it to my favorites. But I'm really disappointed that many people will only throw problems in the group, but they will not learn to Google them themselves. I even told them where to find them, and I ran to ask for details. Is it really that difficult to test it by yourself?
Even now, I don't even want to watch the answers I have provided. I want to watch teaching videos and ask for remote assistance ~
Original post address:
Http://www.cnblogs.com/zhangleixp/archive/2006/11/11/installshielddatabase.html
This article describes how to use InstallShield to install and uninstall databases. It is tested in the InstallShield 11.5 premier edition and InstallShield 12 premier edition environments. (About InstallShield, such a well-known InstallationProgramI will not introduce the production tools much .)
(For packaging. NET Framework in InstallShield, see about deploying. NET Framework Using InstallShield.) Zhang Lei. Live
1. Open "SQL scripts View", 1
Figure 1. Open the SQL Script View
2, Create a connection, assuming "masterconnection", according to Figure 2 and Figure 3Set the connection attributes.
Figure 2 establish a connection
Figure 3 set connection attributes
3. Create a script under "masterconnection" and set attributes 4The script 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: relaybookkeeping is the database we need to create.
Figure 4 Create a script
4. Create a new connection "relaybookkeepingconnection" and set the general attribute as shown in Figure 5. The setting of the requirements attribute is the same as that in figure 3.
Figure 5 set connection attributes
5. In the "relaybookkeepingconnectionCreate your own database script.6.
Figure 6 add your own database script
6. Delete the database when uninstalling the program.
The operation is similar to creating a database (Steps 1, 2, 3. Create a connection. On the general properties page, set the database name to master. Then add a script file. When the runtime attribute is set to unload, the content is:
Use master
Drop database relaybookkeeping
Go
[Edit the following content at]
I saw in my help today that I installed SQL Server and Oracle. Post at the end.
Creating a sample project that will create a SQL Server catalog by running customized SQL script
Task
The following describes how to create a sample project that will create a SQL Server catalog on the target machine by running customized SQL script:
-
- Create a new InstallShield project.
-
- Go toProperty ManagerView.
- Create a new property named "is_sqlserver_database2 ".
-
- Go toSQL scriptsView.
-
- Create a new connection and call it "newconnection1 ".
-
- Click newconnection1 In the explorer, and select the General tab.
-
- Specify "testsqlserver" as the target server name, and clearCreate catalog if absentOption.
-
- SelectServer AuthenticationOption and specify "sa" asLogin IDAnd leavePasswordField blank.
-
- ClickRequirementsTab.
-
- Select the SQL Server check box and clear the Oracle and MySQL check boxes as the target databases.
-
- Right-clickNewconnection1In the explorer, and chooseNew script.
-
- Rename the new script "newscript1 ".
- SelectNewscript1In the explorer, and clickScriptTab.
-
- Add the following script:
Create Database [testdb] On (name = n' testdb', filename = n' c: \ Program Files \ Microsoft SQL Server \ MSSQL \ data \ testdb. MDF ', size = 3, filegrowth = 10%) log on (name = n' testdb_log', filename = n' C: \ Program Files \ Microsoft SQL Server \ MSSQL \ data \ testdb. ldf', size = 1, filegrowth = 10%)
Collate SQL _latin1_general_cp1_ci_as
-
- ClickRuntimeTab, selectRun script during login, And then clear the other script execution options.
-
- Create a new connection inSQL scriptsView, and call it "newconnection2 ".
-
- ClickNewconnection2In the explorer, and selectAdvancedTab.
- FromTarget catalog property nameBox, choose is_sqlserver_database2.
-
- ClickGeneralTab.
-
- Specify "testsqlserver" as the target server name and "testdb" as the catalog name, and then clearCreate catalog if absentOption.
-
- SelectServer AuthenticationOption and specify "sa" asLogin IDAnd leavePasswordField blank.
-
- ClickRequirementsTab.
-
- SelectSQL ServerCheck box and clearOracleAndMySQLCheck boxes as the target databases.
-
- Right-clickNewconnection2In the explorer, and chooseNew script.
-
- Rename the new script "newscript2 ".
- SelectNewscript2In the explorer, and clickScriptTab.
-
- Add the following script:
Create Table testtable (testcolumn1 char not null primary key)
-
- Click the runtime tab, select run script during install, and then clear the other script execution options.
Creating a sample project that will create an oracle catalog by running customized SQL script
Task
The following describes how to create a sample project that will create an oracle catalog on the target machine by running customized SQL script:
-
- Create a new InstallShield project.
-
- Go toProperty ManagerView.
-
- Create a new property named "is_sqlserver_database2 ".
-
- Go toSQL scriptsView.
- Create a new connection and call it "newconnection1 ".
-
- ClickNewconnection1In the explorer, and selectGeneralTab.
-
- Specify "// sch01jsmith.macrvision.com: 1521/orcl" as the target server name, and clearCreate catalog if absentOption.
-
- SelectServer AuthenticationOption and specify "Scott" as the login ID and "Scott" as the password.
-
- ClickRequirementsTab.
-
- SelectOracleCheck box and clearSQL ServerAndMySQLCheck boxes as the target databases.
-
- Right-clickNewconnection1In the explorer, and chooseNew script.
-
- Rename the new script "newscript1 ".
- SelectNewscript1In the explorer, and clickScriptTab.
-
- Add the following script:
Create tablespace test_ts logging datafile '/muddle/Oracle/STs/test01.dbf' size 64 K autoextend on next 2 m maxsize Unlimited
Go
Create user test_user identified by mypswd default tablespace test_ts quota unlimited on test_ts
Go
Grant connect to test_user
Go
Grant DBA to test_user
Go
Alter user test_user default role all
Go
-
- ClickRuntimeTab, selectRun script during login, And then clear the other script execution options.
-
- Create a new connection inSQL scriptsView, and call it "newconnection2 ".
- ClickNewconnection2In the explorer, and selectAdvancedTab.
-
- FromTarget catalog property nameBox, choose is_sqlserver_database2.
-
- ClickGeneralTab.
-
- Specify "// sch01jsmith.mac rvision.com: 1521/orcl" as the target server name and "test_user" as the catalog name, and then clearCreate catalog if absent Option.
-
- SelectServer AuthenticationOption and specify "test_user" as the login ID and "mypswd" as the password.
-
- ClickRequirementsTab.
-
- SelectOracleCheck box and clearSQL ServerAndMySQLCheck boxes as the target databases.
- Right-clickNewconnection2In the explorer, and chooseNew script.
-
- Rename the new script "newscript2 ".
-
- Select newscript2 In the explorer, and click the script tab.
-
- Add the following script:
Create Table testtable (testcolumn1 char not null primary key)
-
- ClickRuntimeTab, selectRun script during install, And then clear the other script execution options.