sql server - INSERT SELECT Statement and Rollback SQL -


I is working on the creation of a query that uses the inset select statement using MS SQL Server 2008:

Pseudocode:

 

Code> Try {Start Transactions; Query; Committed; } Hold {rollback; }

If there are approximately 40 M lines in Tab 2, then at the moment of inserting Table 1, if there is an error between INSERT, then only one rollback from the INSERT SELECT statement or me Need to use a transaction to maintain data integrity?

Is it necessary to use a transaction? Or SQL Server itself uses a transaction for this kind of sentence itself.

An individual SQL command is atomic, it will either be completed or rolled back.

If it is complete, then the transaction that can roll back that order. If it is outside the transaction, then it is committed to completion.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -