Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Dynamic Query in UDF? Expand / Collapse
Author
Message
Posted Thursday, May 29, 2008 11:48 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, October 14, 2009 1:56 AM
Points: 438, Visits: 754
Hi all,

Is it possible to use Dynamic Query in UDF?

If yes, tell me how to execute this dynamic query inside of the UDF.



---
Post #508829
Posted Friday, May 30, 2008 12:22 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 1:37 AM
Points: 28, Visits: 366
Hi sqluser,

you cannot execute a stored procedure or dynamic statement from a function. But what about ...
http://www.sqlservercentral.com/articles/T-SQL/61918/ and http://www.sommarskog.se/share_data.html#OUTPUT


CU
tosc


www.insidesql.org
Post #508850
Posted Wednesday, June 4, 2008 6:37 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 11:30 PM
Points: 36,706, Visits: 31,156
sqluser (5/29/2008)
Hi all,

Is it possible to use Dynamic Query in UDF?

If yes, tell me how to execute this dynamic query inside of the UDF.
---

What's the query?


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #511305
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse