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 |
|
Nitu
Yak Posting Veteran
81 Posts |
Posted - 2006-03-09 : 15:44:04
|
| Here is example of what i want to do.select @fieldCount = Count(@field1) from table1 where field2 = @variablepassed_to_sp"lets say table1 has 6 rows for the condition field2 = @variablepassed_to_sp"now i want to process each row,set @i = 1while @i <= @fieldCountselect @tempVar(i) = field1 from table1 where field2 = @variablepassed_to_spselect field3, field6 from table2 where field4 = @tempvar(i)if field3 <> field6 call procedure3elsecall procedure4set @i = @i + 1Can you give me a sample code to do the above.Thanks a lot in advance,Nitu |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2006-03-09 : 17:15:40
|
| Can you explain what you're trying to do, rather than the way you've chosen to tackle it?There is probably a much simpler solution to this problem. |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
|
|
|
|
|