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.
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.
Do it in a transaction, so that either entire insert get successful or nothing will insert, No partial inserts.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
ASKER
how can i prevent that in stored procedures?
on a insert statement.
on a insert statement.
ASKER
how do i do a transaction in a stored procedure?
this can be helpful too
http://blog.sqlauthority.c om/2010/06 /02/sql-se rver-store d-procedur e-and-tran sactions/
http://blog.sqlauthority.c
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks