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 |
DURGESH
Posting Yak Master
105 Posts |
Posted - 2008-08-20 : 03:02:28
|
HI ALLi am using cursor to perform certain operation based on a value selected. If the value is null or 1 it should exist from the cursorcan anybody help me to solve this issuethanks in advanceregardsDUrgesh j |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-08-20 : 04:00:20
|
Here is an example:declare @checkval nvarchar(255)declare test_cursor cursor forselect[name]fromsys.objectsopen test_cursorfetch next from test_cursor into @checkvalwhile @@fetch_status = 0 beginprint @checkval-- Here comes the conditional exitif @checkval = 'syscerts' begingoto exitcursorend-- Here ends the conditional exitfetch next from test_cursor into @checkvalendexitcursor:close test_cursordeallocate test_cursorWebfredPlanning replaces chance by mistake |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-20 : 04:01:21
|
use BREAK |
|
|
|
|
|