Page 1 of 1

MS SQL Server Script Action

Posted: Thu Dec 27, 2007 8:09 am
by ulrichard
Hi everyone,

I'm currently evaluating InstallAware to see if it's the propper replacement for InstallShield.
So far, everything worked like a charm, with exception of one thing:
I can't get the SQL script to execute.

With the installer, I install SQL Server 2005 express with a named instance.
Then I want to run a script to import a database backup file from the SupportDir.
The database get's created but it's empty, so the import didn't work.
I don't get any errormessage, only the Variable gets an error value.

Here is what I'm trying:

~InstallAware Clipboard Data~
~MS SQL Server~
~{2B0E1DCC-D3BA-48E3-BD19-3B8D16F397E4}~
~(local),BormStudent,BormStudent,sa,default,SQLSUCCESS,"RESTORE DATABASE [BormStudent] FROM DISK = '$SUPPORTDIR$\\BormAzubi.bak' WITH FILE = 1,$NEWLINE$NOUNLOAD ,$NEWLINE$STATS = 10,$NEWLINE$RECOVERY ,$NEWLINE$REPLACE ,$NEWLINE$MOVE N'BormStudent_Data' TO N'$PROGRAMFILES$\\Microsoft SQL Server\\MSSQL$BormStudent\\data\\BormStudent.mdf',$NEWLINE$MOVE N'BormStudent_Log' TO N'$PROGRAMFILES$\\Microsoft SQL Server\\MSSQL$BormStudent\\data\\BormStudent_log.ldf'$NEWLINE$GO",-1,-1~
~mMSSQLIDE.dll\\mMSSQLExec.dll~


any hints are greatly appreciated
Richard

Posted: Fri Dec 28, 2007 8:58 am
by Gizm0
Try to insert use [master]; go; before the restore. Also, before the restore, make sure you DROPPED all the connection to that database, otherwise the restore won't be successful. For more info, try opening the SQL Server Management Studio Express, and click on "Script" button on the Restore/Backup Form.