Control Freak
Control Freak

Reputation: 13213

Exit out of WHILE @@FETCH_STATUS = 0 in db_cursor

Is there a way to exit out of the WHILE @@FETCH_STATUS = 0 while performing a db_cursor?

I tried SET @@FETCH_STATUS = 1, but as i expected, an error. Help?

Upvotes: 5

Views: 15765

Answers (1)

Martin Smith
Martin Smith

Reputation: 453037

You can use BREAK to exit a while loop.

Upvotes: 21

Related Questions