Populate varaible from datasource | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Populate varaible from datasource

Caught in a loop trying to find info. I need to read a value from a datareader source and based on that value I need to dynamically create a SELECT statement that will be used by another task. I want to store the query string in a variables. But can’t seem to find and info on how to do this. Any help will be greatly appreciated.
I had a brief go at this and couldn’t manage it.
I didn’t have much time so just stored the query in an xml file and set the parameter using a configuration file.
I then altered the query using an expression for the source. I’ll probably be visiting it again later.