This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Create DataBase Script SQL
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 15, 2008
07:47 AM
Create DataBase Script SQL
Hello,
I have a problem with de procedure to create one D.B on SQL...for example in my project define one data base path, and in this script....
CREATE DATABASE [AURALL50] ON (NAME = N'AURALL50', FILENAME = N'C:\Archivos de programa\Microsoft SQL Server\MSSQL$SERVIDOR\Data\AURALL50.mdf' , SIZE = 4, FILEGROWTH = 10%) LOG ON (NAME = N'AURALL50_log', FILENAME = N'C:\Archivos de programa\Microsoft SQL Server\MSSQL$SERVIDOR\Data\AURALL50_log.LDF' , FILEGROWTH = 10%)
COLLATE Modern_Spanish_CI_AI
i need define on runtime the path to the database directory...create before.
Thank's and sorry for my bad english.
Pedrer
I have a problem with de procedure to create one D.B on SQL...for example in my project define one data base path, and in this script....
CREATE DATABASE [AURALL50] ON (NAME = N'AURALL50', FILENAME = N'C:\Archivos de programa\Microsoft SQL Server\MSSQL$SERVIDOR\Data\AURALL50.mdf' , SIZE = 4, FILEGROWTH = 10%) LOG ON (NAME = N'AURALL50_log', FILENAME = N'C:\Archivos de programa\Microsoft SQL Server\MSSQL$SERVIDOR\Data\AURALL50_log.LDF' , FILEGROWTH = 10%)
COLLATE Modern_Spanish_CI_AI
i need define on runtime the path to the database directory...create before.
Thank's and sorry for my bad english.
Pedrer
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 15, 2008
12:41 PM
What project type are you using?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 15, 2008
01:59 PM
I'm use the MSI Basic ...thank's
pedrer
pedrer
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 15, 2008
02:30 PM
You need to use the SQL Script's Text Replacement functionality in order to accomplish your requirements.
1. Add the following Text Replacement entry for your script in the SQL Scripts view:
Find What: %DatabaseDataDir%
Replace With: [MYDBDATADIR]
2. Change your script as follows:
[Code]CREATE DATABASE [AURALL50] ON (NAME = N'AURALL50', FILENAME = N'%DatabaseDataDir%\AURALL50.mdf' , SIZE = 4, FILEGROWTH = 10%) LOG ON (NAME = N'AURALL50_log', FILENAME = %DatabaseDataDir%\AURALL50_log.LDF' , FILEGROWTH = 10%)
COLLATE Modern_Spanish_CI_AI[/Code]
MYDBDATADIR is a custom Windows Installer property or Directory identifier that you need to specify.
Hope this helps.
1. Add the following Text Replacement entry for your script in the SQL Scripts view:
Find What: %DatabaseDataDir%
Replace With: [MYDBDATADIR]
2. Change your script as follows:
[Code]CREATE DATABASE [AURALL50] ON (NAME = N'AURALL50', FILENAME = N'%DatabaseDataDir%\AURALL50.mdf' , SIZE = 4, FILEGROWTH = 10%) LOG ON (NAME = N'AURALL50_log', FILENAME = %DatabaseDataDir%\AURALL50_log.LDF' , FILEGROWTH = 10%)
COLLATE Modern_Spanish_CI_AI[/Code]
MYDBDATADIR is a custom Windows Installer property or Directory identifier that you need to specify.
Hope this helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 15, 2008
03:16 PM
Thank's so much...but on my install, i dont now who make that appear's the data base folder dialog.
pedrer
pedrer
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 15, 2008
05:24 PM
Please refer to the help topic "Creating Installations > Defining the End-User Interface > Working with Dialogs in Basic MSI Projects > Displaying Dialogs During Basic MSI Installations". You may need to repeat the process for the Back button on the subsequent dialog box.