Link to home
Start Free TrialLog in
Avatar of JCWEBHOST
JCWEBHOST

asked on

database

Hey guys, i have an mdf database and want to know what happens if i insert into a database and the internet cuts off?

the half the information be entered?

or do i need to write a trigger to rollback my transaction?

i am using sql 2008 server where my database is kept.
Avatar of Anuj
Anuj
Flag of India image

Do it in a transaction, so that either entire insert get successful or nothing will insert, No partial inserts.
SOLUTION
Avatar of RiteshShah
RiteshShah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JCWEBHOST
JCWEBHOST

ASKER

i am using stored procduers
But, yes, if you have more than one INSERT statement in one batch, it could be possible that few INSERT statement works and later few wouldn't. in that case, transaction would be helpful
how can i prevent that in stored procedures?

on a insert statement.
how do i do a transaction in a stored procedure?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks