I have a function…in which I have return type as table variable…
But performance will be increased if we use temp tables..as we have more data.
I have a function…in which I have return type as table variable… But performance
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.
No, you cannot “return” a temp table – you can create that temp table before calling your function, and have your function write data into that temp table.
But this has a tendency to get rather messy …. you need to make sure to have the temp table created before calling the function…..
Have you really, honestly measured the performance of the two approaches?? I don’t think temp tables are just always faster…. the approach with the table variable seems a lot cleaner and more intuitive to me.