Answered by:
Pass User Defined Table Types (TVP) as arguement of User defined function in MSSQL2008

Question
-
Hi,
I want to pass User Defined Table types to user defined function, that function has to return two floating type arguement.
please anyone guide me the procedure to do.
Regards
Kasim
Sunday, September 9, 2012 6:48 AM
Answers
-
Check this blog post for details on using a TVP with a UDF: http://beyondrelational.com/modules/2/blogs/77/posts/11288/table-valued-parameters-to-a-table-valued-function-underappreciated-features-of-microsoft-sql-server.aspx
~manoj | email: http://scr.im/m22g
http://sqlwithmanoj.wordpress.com
MCCA 2011- Proposed as answer by Naomi N Sunday, September 9, 2012 2:25 PM
- Marked as answer by Kasim Mandapam Monday, September 10, 2012 4:33 AM
Sunday, September 9, 2012 8:32 AM
All replies
-
Check this blog post for details on using a TVP with a UDF: http://beyondrelational.com/modules/2/blogs/77/posts/11288/table-valued-parameters-to-a-table-valued-function-underappreciated-features-of-microsoft-sql-server.aspx
~manoj | email: http://scr.im/m22g
http://sqlwithmanoj.wordpress.com
MCCA 2011- Proposed as answer by Naomi N Sunday, September 9, 2012 2:25 PM
- Marked as answer by Kasim Mandapam Monday, September 10, 2012 4:33 AM
Sunday, September 9, 2012 8:32 AM -
Thanks Manu..
Regards
Kasim
Monday, September 10, 2012 4:33 AM -
Hi Manu,
I have one more question. how to execute Dynamic SQL in user defined function?
Regards
Kasim
Monday, September 10, 2012 7:22 AM -
You can't execute dynamic SQL inside a UDF, that's one of a limitation.
Why do you want dynamic SQL? Can't you do it with SP?
~manoj | email: http://scr.im/m22g
http://sqlwithmanoj.wordpress.com
MCCA 2011Monday, September 10, 2012 8:15 AM