Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Within the userdefined function temptable

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2011-08-17 : 13:08:50
Is it possible to create temp table with insert to temp table statements with in a userdefined function?

When i placed insert statemenrts to insert data to temptable within userdefined functions i am getting error messages.

thank you very much for the helpful info.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-08-17 : 13:15:12
You can't use a temporary table in a user-define function, but you can use a table variable instead.

But your question leads me to believe you've got a mess and will have performance issues. You may want to post your problem for us to help you through this.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -