SQL server transaction

只愿长相守 提交于 2020-01-02 12:14:29

问题


I need to understand about sql server transaction? I have gone through some articles available on google but I have not understood anything. Can anyone help me?


回答1:


You can explicitly start a transaction by writing BEGIN TRANSACTION. You end the transaction by running COMMIT TRANSACTION.

Before the COMMIT is run, the tables affected by your query can still be rolled back to the state they were in at the BEGIN TRANSACTION point-in-time.

This is useful when you are writing a stored procedure that is pumping a lot of data between tables. By dividing it in smaller parts using transactions, the whole bunch does not need to be "rolled back" when the procedure hangs, an error occurs or you cancel it manually.

An article that elaborates on this is for example this one.




回答2:


See Understanding Transactions.




回答3:


Database Journal have a lot of good articles abaut mentoed subject



来源:https://stackoverflow.com/questions/3913806/sql-server-transaction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!