MS SQL Server Script Action

For all your non-technical questions.
Post Reply
ulrichard
Posts: 150
Joined: Thu Dec 27, 2007 5:45 am
Location: Switzerland
Contact:

MS SQL Server Script Action

Post 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
Gizm0
Posts: 339
Joined: Wed Nov 09, 2005 8:47 pm

Post 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.
Panagiotis Kefalidis
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
Install[b]Aware[/b] Software Corporation
Post Reply