Reputation: 2974
I have programmed a function with 1) Create Table in Tempdb
Checking existence of table
IF OBJECT_ID('tempdb..#Results') IS NOT NULL
DROP TABLE #Results
inside of it. The results are in Temp tables show be backed
can I use a Table Value function for it? or it just should an insert
Upvotes: 1
Views: 34
Reputation: 17943
can I use a Table Value function for it? or it just should an insert
No, DML
functions are not allowed inside a function. You need to use a stored procedure to perform the operations you have mentioned.
Read following link for more details on what is allowed and not allowed in a function.
SQL SERVER – User Defined Functions (UDF) Limitations
Upvotes: 2