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 |
|
rammohan
Posting Yak Master
212 Posts |
Posted - 2008-02-20 : 09:19:54
|
| hi,here i am writting a storedprocedure sp_test. i have a UDF which accepts two i/p parameters and returns table. so how i can call n execute this UDF inside a procedure. i will send i/p parameters for UDF from procedure. after returning table from UDF in which data type i have to recive in stored procedure.pls help me on thisOne can never consent to creep,when one feels an impulse to soarRAMMOHAN |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-02-20 : 09:32:11
|
| You can consider table returned from UDF as normal table:Select * from dbo.UDF_test(@param1, @param2)Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
rammohan
Posting Yak Master
212 Posts |
Posted - 2008-02-20 : 09:37:33
|
| hi,Thank you for giving the solution. i need to get to get the each record from the table(i.e table returned by UDF) n need to perform some operations in the same procedure.in that case, how i have to store it in my procedure n access it. i.e what will be the definition of parameter which i have to provide to receive the table from UDFOne can never consent to creep,when one feels an impulse to soarRAMMOHAN |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-02-20 : 09:42:06
|
You can either store the table returned by UDF in table variable or Temp table.Declare @Temp table(col1 ..,col2 ..,...)insert @TempSelect * from dbo.UDF_test(@param1, @param2) Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
rammohan
Posting Yak Master
212 Posts |
Posted - 2008-02-20 : 09:48:36
|
| hi,is there any command to get row by row from table in sqlserver 2005.my task is specifically:i need to get the all row values at column1 of this table one by one n need to pass to another query.is there any way?One can never consent to creep,when one feels an impulse to soarRAMMOHAN |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-02-20 : 09:51:46
|
| If you can describe whole scenario, we may be able to help find out solution.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
rammohan
Posting Yak Master
212 Posts |
Posted - 2008-02-20 : 10:06:15
|
| hi,i have three tables named table1,table2,table3:table1 rough data:id val1 12 35 4table2 rough data:id val7 910 2313 34table3 strucutre:id1 int foreign key to table1id2 int foreign key to table2here from table3 i need to get the values of id1,id2 n need to perform addition operation of that values n need to match with integer 25.if first match sum is say 18, then it need add next match sum to this value i.e if second match sum is 7 then 18 + 7 = 25 satisfied then it needs to return this two rows.so i need to perform this operation untill n unless i get the 25(example).please suggest me a way One can never consent to creep,when one feels an impulse to soarRAMMOHAN |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|
|
|