Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

cursor problem Expand / Collapse
Posted Thursday, August 21, 2008 12:37 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, June 15, 2009 12:57 PM
Points: 32, Visits: 114
hi members,

I need help to make a cursor in a stored procedure to make it skip to the next id if that particular row has an error. and also I want to display the error number,error message and also for which record that error came in the database and record this error number,error message and also the record details into some table.

I wanted only through cursor as I know the below scenario can be done through set based sql and also through Common table expressions. But I want through cursor and also

My cursor want to increase sal by 100 to each empno.

Eg: empno ename sal
10 xxx 1000
20 yyy 2000
30 zzz 3000


errorno errormessage empno ename sal
20 some error 20 yyy 2000

If anyone can give with example it would be great.

Post #556834
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse