MayankRank #4,018 · 371 reputationPosted Aug 20, 2018, 1:50 AM EDT
0
Hi Pravat, Sanwar
I know I can't use temp table in udf in sql server.I want to know the reason.
Why we are able to use table variable?
0
Pravat KumarRank #2,456 · 573 reputationPosted Aug 20, 2018, 6:18 AM EDT
0
Hello Mayank,
This is the limitation of the user-defined function.
the objects can't be created inside the user-defined function.
the user-defined function can't execute the dynamic query or temporary tables.
0
Jignesh KumarRank #91 · 22.9K reputationPosted Aug 20, 2018, 8:02 AM EDT
0
Hi Mayank,
I want to point out one thing here, We all know DML we can not perform inside function which is limitation of function. When we try to create #tempTable and try to insert records in temp table it means it is DML operation.
Sanwar RanwaRank #23 · 44.7K reputationPosted Aug 17, 2018, 2:34 AM EDT
Pravat KumarRank #2,456 · 573 reputationPosted Aug 17, 2018, 3:20 AM EDT
MayankRank #4,018 · 371 reputationPosted Aug 20, 2018, 1:50 AM EDT
Pravat KumarRank #2,456 · 573 reputationPosted Aug 20, 2018, 6:18 AM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Aug 20, 2018, 8:02 AM EDT
MayankRank #4,018 · 371 reputationPosted Aug 21, 2018, 12:59 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts