Page 1 of 1

Newbie help with Express Eval - restore a SQL DB BAK

Posted: Thu Oct 25, 2012 11:46 pm
by freddie10538
Ok, so as per my posting on Pre-Sales, I have my eval copy of express.

Most of the things I want to do during the install are standard, including SQL Express 2008r2 with /SQLCOLLATION=SQL_Latin1_General_CP1_CS_AS
The reason I have to do this, is users here are infamous for fiddling with their regional settings, and if I don't set the collation, my backup will produce collation errors when it is accessed!

So far, I am a suffering from the malady of not having seen any real-world examples of how to use InstallAware and have no previous experience with any other installers!

Which leads me to my question. In the Server Configuration->SQL Databases section, I can add a SQL script.
Now assuming my script looks like this:

RESTORE FILELISTONLY
FROM DISK = 'c:\temp\MANK0081.bak'
GO

ALTER DATABASE MANK0081
SET SINGLE_USER WITH
ROLLBACK IMMEDIATE

RESTORE DATABASE MANK0081
FROM DISK = 'D:MANK0081.bak'
WITH MOVE 'MANK0081' TO 'X:MANK0081.mdf',
MOVE 'MANK0081' TO 'X:MANK.ldf'

ALTER DATABASE MANK0081 SET MULTI_USER
GO

How do I code that script to use the $$ Installaware variables in the script?

The "c:\temp" part needs either be hard-coded or a $somevar$ that was previously created.
On that subject, I'd prefer the installer to copy the MANK0081.BAK file to the (whatever SQL version)\MSSQL\Backup folder, but I don't know how to tell
it to do that? What's the $variable$ for the (whatever SQL version)?

Back to the script

the X: definitely needs to be the same $variable$ that I used when copying the .bak file.

Failing that, once the SQL Server instance has been installed, I can run an exe I write myself, that will login to the server
and execute the script. I'll make sure the installer runs that .exe in the Advanced Options->Run Programs section.

Any comments/assistance appreciated. I'm sure the answers to these questions will help other newbie InstallAware users too.
Thanks
Freddie

Re: Newbie help with Express Eval - restore a SQL DB BAK

Posted: Fri Oct 26, 2012 12:06 am
by freddie10538
Further to this, I see my IA Express Eval, doesn't have a project manager!
Could this be why I am so confused?

Re: Newbie help with Express Eval - restore a SQL DB BAK

Posted: Fri Oct 26, 2012 8:22 am
by FrancescoT
Dear User,

In fact, with the Express edition it is not available the MSI scripting capability and due of this, you can't use IA variables with your MS SQL script.

For more information about IA editions and features / differences, you may use the link below.
http://www.installaware.com/right-edition.htm

Hope this helps you.