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 |
|
misterraj
Yak Posting Veteran
94 Posts |
Posted - 2004-12-17 : 03:48:49
|
| Hi all,I have a simple cursor like this,DECLARE CURSOR_FOR_INLINE_SELECT CURSOR FOR SELECT TRNS_ID FROM EEVT OPEN CURSOR_FOR_INLINE_SELECT FETCH NEXT FROM CURSOR_FOR_INLINE_SELECT INTO @VAR1WHILE (@@FETCH_STATUS <> -1)BEGINPRINT @VAR1FETCH NEXT FROM CURSOR_FOR_INLINE_SELECT INTO @VAR1ENDCLOSE CURSOR_FOR_INLINE_SELECTDEALLOCATE CURSOR_FOR_INLINE_SELECTNow that only the selected field(only one, here in case trns_id) is put into a variable, suppose the table contains 50 fields, and I need all the value of these fields should i write INTO @field1, @field2, @field3,,,@field50pls suggest..Thanks. |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-12-17 : 05:14:02
|
yes you would need 50 variavles.but this is not the way to go. cursors are not good!!tell us what you're doing. i sure we can come up with a set based solution.Go with the flow & have fun! Else fight the flow |
 |
|
|
misterraj
Yak Posting Veteran
94 Posts |
Posted - 2004-12-17 : 05:23:40
|
| what I need is to know all the values of the columns of all the records one by one......... |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-12-17 : 05:27:03
|
i get that but what is the bigger picture? i doubt there is really a need for row by row processing.Go with the flow & have fun! Else fight the flow |
 |
|
|
|
|
|