SQL query - return value to Property
Hey everyone,
Im looking to make more of the SQL function and use it to return a value from a database to the Wise installation package.
As you would be aware, retrieving the default data path for a select SQL Server instances is not an easy process to do getting the information from the registry.
What I am wanting to achieve is, once the SQL Server is selected that is to house a database being installed, return to the installer the folder location of the default path and set this path as the INSTALLDIR.
The script to run over the sql server is easy enough.
SELECT SUBSTRING(filename, 1, CHARINDEX(N'master.mdf', LOWER(filename)) - 1) FROM master.dbo.sysdatabases where name = 'master'
How do I assign the outcome of this script to a property ?
Regards
Shaun
Tencia Support
Comments
To do this, I believe you will need to run your SQL query from a custom action, using some vbscript. Once your SQL command returns a value to a vbscript variable, you can then use the method
session.property("PROPERTYNAME") = var
This will populate the public property PROPERTYNAME with the content of the variable var
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
Would you like to reply?
Login or Register to post your comment.