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.
Author |
Topic |
hotshot_21
Yak Posting Veteran
97 Posts |
Posted - 2007-05-17 : 00:58:37
|
i have a multistatement table function which is called from storedProc and it calulates certain values and returns it. now iwant to insert these calculated values into other table can this be done?SP is Create Proc (@a int,@b int,@c int)ASBeginSelect * FRom dbo.func1(@a,@b,@c)Fucntion is Ceate Function dbo.Func(@a int,@b int ,@c int)Returns @T table(@X int, @Y int, @Z int)asbeginset @X="Calculate"Set @Y="Calculate"set @Z="Calculate"Insert Into @T Values(@X,@Y,@Z)Return @TNow i want to enter the values in table @T into some other table how do i do it? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-17 : 01:00:54
|
You have to use Stored Procedure. You can't do this in a function KH |
|
|
hotshot_21
Yak Posting Veteran
97 Posts |
Posted - 2007-05-17 : 01:03:31
|
the table values @T is returned in storedProc so how do i insert into other table the values in @T using stored proc |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-17 : 01:05:47
|
[code]insert into sometalbe(x, y, z)select x, y, zfrom dbo.func1(@a,@b,@c)[/code] KH |
|
|
hotshot_21
Yak Posting Veteran
97 Posts |
Posted - 2007-05-17 : 01:06:55
|
thank u,i appreciate ur help KHTan |
|
|
|
|
|
|
|