Retrieving main db name to execute 'Views' in server

Got a problem you cannot solve? Try here.
Post Reply
serina
Posts: 47
Joined: Tue Jun 30, 2009 10:30 pm

Retrieving main db name to execute 'Views' in server

Post by serina »

Hi there,

Currently I'm working on a db installation setup...so far everything is working on fine with my installation setup except one thing. The 'Create View' part in my SQL script is not being executed into my sql server even though there are so many 'views' in my script. There are actually 2 databases 'MainDB' and also 'HRMSDB' where all the 'views' are being created from these two databases as per in the script.

I've actually created a dialog to retrieve the 'MainDB' name and also 'HRMSDB' name from the user where it should replace these db names with the ones user have defined during the installation process. I've even set variables for these two 'MainDB' and 'HRMSDB' in the 'Writes Value To Variable' section.

Now, what I would like to know is how is it possible for both the db names to be referred with the names that user have defined during the installation process?? The db names where the 'views' are being created from need to be changed as well in the script in order for the 'views' to be executed in the sql server.

Hoping for a solution...

Thanks in advance.

Serina
neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK

Post by neillans »

If I am following what you are trying to do, you will need to store the view SQL in your MSI Code (or load it from a file), parse it to replace the db name, and then execute it.
Andy Neillans
serina
Posts: 47
Joined: Tue Jun 30, 2009 10:30 pm

Post by serina »

Hi Andy,

The view SQL script is actually inside my db SQL script as well. Its not another separate script or what. Therefore, I'm using the same db name which suppose to be replaced in the SQL script with the db name that user have defined during the installation process. This db will eventually create the database in the SQL server whereby it should create the views as well in the same db. I've loaded this script using the MS SQL Server Script in MSIcode.

Well, hope you could get what I'm trying to enquire right now....

Thank you!

Serina
Post Reply