I have several user defined table-valued functions and one view which has the same columns in returned table. How can I reuse return table definition?
I have several user defined table-valued functions and one view which has the same
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In SQL Server 2008, you can use a User-Defined Table Type.Prepare for a lot of copy-and-pasting.
(Edit: Apparently you can’t return a UDTT from a UDF. It would have made sense, but there’s just no syntax for it. So it’s either copy and paste, or use an inline table-valued UDF if you can.)