Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
1.75/5 (4 votes)
See more:
How to update a foreign key in table B with primary key of another table A via cursor and also to rollback if any issue occurs on running cursor?
There are 1000 records in Table B with foreign key value to be inserted fetching the primary Key value of Table A. I am using asp.net with c#.
Posted
Comments
Prasad Avunoori 21-May-14 7:53am    
Can you please share your two tables structure? That could be helpful.
Prasad Avunoori 21-May-14 7:55am    
For Transaction:
Begin Try
Begin Transaction
--Cursor comes here
Commit
End Try
Begin Catch
Rollback
Raiserror("Erro occured", 16,1)
End Catch
ZurdoDev 21-May-14 8:06am    
This does not make sense. Can you explain more clearly what you need to do?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900