Click here to Skip to main content
15,886,783 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have four insert statement in my stored procedure, if any reason if fourth insert statement showing some error, does data will be inserted in all the successfully executed statement within procedure, if yes , please share the reason.
Posted

1 solution

Yes it will because the INSERT statements take immediate effect. If this isn't what you want then you need to put your commands in a TRANSACTION so that you can commit or cancel them (rollback) as a single unit.

EDIT AL: here is a good article on SQL Server Transactions and Error Handling[^]
 
Share this answer
 
v2

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