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 |
|
yaman
Posting Yak Master
213 Posts |
Posted - 2008-09-16 : 10:06:49
|
| Sir , I am Using While loop in place of Cursor .I want one by one record from table and perform Some action using Fetch Record .Like I am Fetching Itemid From Item table Used That Itemid I am update Item table Sir How i am Find Item id One by One Like Cursor in to andther temporary variable ?Yaman |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-16 : 10:09:13
|
| [code]DECLARE @ID intSELECT @ID=MIN(PK)FROM YourTableWHILE @ID IS NOT NULLBEGIN... perform your looping operationSELECT @ID=MIN(PK)FROM YourTableWHERE PK>@IDEND[/code]PK is primary key |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|