July 8, 2009 at 3:10 am
use exec sp_executesql for it.
refer books online for the same
July 8, 2009 at 3:13 am
Hi,
It can be done with sp_executesql with 'output' variable.
March 9, 2010 at 9:19 pm
Hi,
How can I do it, if I need to do it from a function?
I tried but I got:
'Only functions and extended stored procedures can be executed from within a function.'
March 11, 2010 at 7:08 am
If you need to use dynamic SQL you're better off using a stored procedure instead of a function:
http://stackoverflow.com/questions/150552/executing-dynamic-sql-in-a-sqlserver-2005-function
Will that work with what you're trying to use the function for?
March 11, 2010 at 9:00 am
Yes, it works with stored procedures, but is not "elegant".... anyhow, thanks a lot
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply