This is a multiparter.
1. Given the Statement EXEC('SELECT GetDate()') Returns the current
datetime. Now lets say that 'SELECT GetDate()' Is stored in the database in
the table Temp with an PK of 1.
Is there a way to do this:
EXEC((SELECT QueryVal FROM Temp WHERE Temp_id = 1))
Without having to do this:
SET @tempVar = (SELECT QueryVal FROM Tests WHERE Test_id = 1)
EXEC(@tempVar)
2. If i have a stored procedure which returns an INT can i EXEC the stored
procedure inside of a subquery.
Example:
SELECT * FROM MyTable WHERE MyID = (EXEC sp_getID)
3. Could I combine the two ideas above.
Example:
SELECT * FROM MyTable WHERE MyDate = (EXEC((SELECT QueryVal FROM Temp
WHERE Temp_id = 1)))
I am asking this because i am trying to build an application to query the
database and create groupings based on query values and also allow groups to
include other groups.
Tyler Clendenin
GSL Solutions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
http://www.cfhosting.com