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, May 14, 2013 1:03 AM
Points: 25, Visits: 307
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 04, 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: Today @ 9:01 PM
Points: 33,111, Visits: 27,037
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."

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #511305
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse