Video Screencast Help
Search Video Help Close Back
to help
Not able to make it to Vision this year? Get a sampling in the Best of Vision on Demand group.

SQL query - return value to Property

Updated: 21 May 2010 | 1 comment
Shaun Wilkinson's picture
0 0 Votes
Login to vote


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

Discussion Filed Under:

Comments

EdT's picture
09
Nov
2008
0 Votes 0
Login to vote

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.