My SQL database script will not create the DB in IA...
Posted: Mon Nov 13, 2006 12:35 pm
Hello again;
I'm struggling with how to get an SQL database script to run properly within InstallAware so that the database content gets created.
I have included the sql db creation script in the 'Server Configuration'>'SQL Databases' feature and the database is created, however all the content (tables, etc) is missing.
I am using the variable $TARGETDIR$ in the SQL script (to ensure that the database gets created in whatever path is defined by the user during the installation process).
I know that the sql script is good, because if I run it manually the complete database is created. (Of course I do have to sub-in the path 'C:\\Program Files\\My Company\\My Application\\Database\\IACheck.mdf' in place of '$TARGETDIR$\\Database\\IACheck.mdf' prior to manually running the script)
Originally I thought I had discovered the cause of the failure to create the DB content when I realised that I was encountering a permission issue in attempting to write to the 'Program File...' directory. However I got around that security issue by using the fantastic 'Access Control' feature of InstallAware. However, having resolved the permissions issue I am still left with the same failure in creating the database content via the InstallAware SQL Script Databases>Script feature.
So, to summarise...
+When run through IA, the sql scripting process of IA fails to create the database content.
+If I manually run the sql script through SQL Management Studio, the databse and content is correctly created.
+Note that I have also tested this in IA with the $TARGETDIR$ removed from the sql script and the full path inserted instead of the $TARGETDIR$, however this also fails to create the db content too.
Any help would be greatly appreciated!
Steve
Following is a small section of the script that shows how I am defining the $TARGETDIR$.
CREATE DATABASE [IACheck]
ON (NAME = N'IACheck_Data', FILENAME = N'$TARGETDIR$\\Database\\IACheck.mdf' , SIZE = 18, FILEGROWTH = 10%)
LOG ON (NAME = N'IACheck_Log', FILENAME = N'$TARGETDIR$\\Database\\IACheck_log.ldf' , SIZE = 10, FILEGROWTH = 10%)
COLLATE SQL_Latin1_General_CP1_CI_AS
GO
I'm struggling with how to get an SQL database script to run properly within InstallAware so that the database content gets created.
I have included the sql db creation script in the 'Server Configuration'>'SQL Databases' feature and the database is created, however all the content (tables, etc) is missing.
I am using the variable $TARGETDIR$ in the SQL script (to ensure that the database gets created in whatever path is defined by the user during the installation process).
I know that the sql script is good, because if I run it manually the complete database is created. (Of course I do have to sub-in the path 'C:\\Program Files\\My Company\\My Application\\Database\\IACheck.mdf' in place of '$TARGETDIR$\\Database\\IACheck.mdf' prior to manually running the script)
Originally I thought I had discovered the cause of the failure to create the DB content when I realised that I was encountering a permission issue in attempting to write to the 'Program File...' directory. However I got around that security issue by using the fantastic 'Access Control' feature of InstallAware. However, having resolved the permissions issue I am still left with the same failure in creating the database content via the InstallAware SQL Script Databases>Script feature.
So, to summarise...
+When run through IA, the sql scripting process of IA fails to create the database content.
+If I manually run the sql script through SQL Management Studio, the databse and content is correctly created.
+Note that I have also tested this in IA with the $TARGETDIR$ removed from the sql script and the full path inserted instead of the $TARGETDIR$, however this also fails to create the db content too.
Any help would be greatly appreciated!
Steve
Following is a small section of the script that shows how I am defining the $TARGETDIR$.
CREATE DATABASE [IACheck]
ON (NAME = N'IACheck_Data', FILENAME = N'$TARGETDIR$\\Database\\IACheck.mdf' , SIZE = 18, FILEGROWTH = 10%)
LOG ON (NAME = N'IACheck_Log', FILENAME = N'$TARGETDIR$\\Database\\IACheck_log.ldf' , SIZE = 10, FILEGROWTH = 10%)
COLLATE SQL_Latin1_General_CP1_CI_AS
GO