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)
 function calling

Author  Topic 

learntsql

524 Posts

Posted - 2010-08-12 : 07:36:04
how to use same table valued function for multiple coulmns while inserting into table variable.
for eg,
insert into @temptab
select * from dbo.fun(param1,param2),fun(param1,param2)

can we use as above.
TIA.

Kristen
Test

22859 Posts

Posted - 2010-08-12 : 08:08:29
[code]insert into @temptab
select T1.*, T2.*
from dbo.fun(param1,param2) AS T1
JOIN dbo.fun(param1,param2) AS T2
ON T1.SomeID = T2.SomeID
[/code]
Go to Top of Page

learntsql

524 Posts

Posted - 2010-08-12 : 08:24:45
ThankQ very much.
It worked.
Go to Top of Page
   

- Advertisement -