I have a problem with my MS SQL script when i use Variable

Got a problem you cannot solve? Try here.
FSI
Posts: 7
Joined: Tue Oct 23, 2007 8:06 am

I have a problem with my MS SQL script when i use Variable

Postby FSI » Tue Oct 23, 2007 8:58 am

I have a problem with my MS SQL script when i use a Variable instead a path...

SQL Script (With this Code i can create a Database without problems:

CREATE DATABASE [$SQLS_DBNR$] ON PRIMARY
( NAME = N'$SQLS_DBNR$', FILENAME = N'C:\\WOFFPLUS\\$SQLS_DBNR$' , SIZE = 3072KB , FILEGROWTH = 1024KB )
LOG ON
( NAME = N'[$SQLS_DBNR$_log]', FILENAME = N'C:\\WOFFPLUS\\$SQLS_DBNR$_log.ldf' , SIZE = 1024KB , FILEGROWTH = 10%)
GO
... (more)



But, when i replace the C:\\WOFFPLUS\\ with $SQLS_INSTALLDBPFAD$ the SQL Script does not really work :-(

SQL Script (with the problems):

CREATE DATABASE [$SQLS_DBNR$] ON PRIMARY
( NAME = N'$SQLS_DBNR$', FILENAME = $SQLS_INSTALLDBPFAD$$SQLS_DBNR$.mdf' , SIZE = 3072KB , FILEGROWTH = 1024KB )
LOG ON
( NAME = N'$SQLS_DBNR$_log', FILENAME = N'$SQLS_INSTALLDBPFAD$$SQLS_DBNR$_log.ldf' , SIZE = 1024KB , FILEGROWTH = 10%)
GO
... (more)



When i copy the SQL Script (with Variable for the Folder) in a MessageBox --> The SQL Script looks correctly

FSI
Posts: 7
Joined: Tue Oct 23, 2007 8:06 am

Postby FSI » Tue Oct 23, 2007 9:33 am

I have found the problem..

When u use a SQL Script in Installaware, u cant create a a Filename with two Variable

Example: $Path$$File$.mdf --> C:\\TESTSQL\\00001.mdf
($Path$=C:\\TESTSQL\\ $File=00001)


The SQL Script Works with InstallAware, when u set only one Variable for the Full Path + Filename.

$MDFFILE$ = C:\\TESTSQL\\00001.mdf
and u chan use this Variable $MDFFILE$ in the SQL Script

(sorry about my english)...


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 103 guests