Link to home
Start Free TrialLog in
Avatar of n2dweb
n2dwebFlag for United States of America

asked on

Setting a parameter value?

How do I set a parameter to the result of an EXECUTE?
I tried this but got an error.
Set @Y  = EXECUTE (@X)

(the value of @X is a valid select statement)
So that :
Set @X = 'Select top(1) item from dbo.sales where ....'
EXECUTE (@X)
returns a value.
But I need the value assigned to @Y
Please help!
ASKER CERTIFIED SOLUTION
Avatar of Eyal
Eyal
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of n2dweb

ASKER

Part of my issue was that I needed to use nVARCHAR and not VARCHAR