I have a table called projects. This table has about 5 rows in it. In that table there is a fields called projectschema. I have a query that I want to run using the projectschema as a schema variable (@client).
At the end of the query I have a print statement. I need the final output to be 5 lines (one for each row in the projects table).
Example:
Declare @MaxAmount
Set @MaxAmount = (Select max (amount) from @sclient.tableX )
Print the largest amount for @client is @MaxAmount.