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-07-26 : 03:15:58
|
| iam trying to rerieve a certain value from one table and i want to use that vaue inside a UDFiam usinf a table valued function as i have to retireve no of valuesCan i do something like this to retrieve the valueSET @Value=Select Value from Table WHERE xyz='some no.'as this value is being calculated by some other fucntion and now this funcation has to use this at runtime. |
|
|
shallu1_gupta
Constraint Violating Yak Guru
394 Posts |
Posted - 2007-07-26 : 04:37:42
|
| Hi,You can get the value from the table asSelect @Value = Value from Table WHERE xyz='some no.'and can use this variable as a parameter to your table valued function |
 |
|
|
hotshot_21
Yak Posting Veteran
97 Posts |
Posted - 2007-07-26 : 04:55:04
|
| i am trying to get the value from some other table in the same databse. wii this work in UDFSelect @Value = 'ColumnName' from SomeotherTable WHERE xyz='some no. |
 |
|
|
shallu1_gupta
Constraint Violating Yak Guru
394 Posts |
Posted - 2007-07-26 : 05:11:37
|
| it would be good if you can clearly mention what exactly are you trying to achive .. or post your udf. |
 |
|
|
hotshot_21
Yak Posting Veteran
97 Posts |
Posted - 2007-07-26 : 05:24:00
|
| ok wht iam trying to do is my Function 1 is calculatin some value 'Value1' and storing it in a Databsae Table.Now my Function 2 wants to use that 'Value2' which is stored in Databse Table. I want to retrieve that 'Value2' so my Function2 can use it for further calculationThe UDF is as follows CREATE FUNCTION Immediate{somevalues}Returns @Immediate TableDeclare x float,Now i want to use the value2 Select @Value = 'ColumnName' from SomeotherTable SET @x=@valuewill this work.As botht fumction1 & 2 calculate and store at runtime. |
 |
|
|
|
|
|