Posts

Showing posts with the label save transaction

SQL Server, use transactions in a smarter way. The save transaction

Image
Hi Guys, Today we will talk more about transactions ... Oh no, not again! I am hearing some of you are saying  …you have already explained it yesterday! Yes exactly but today's post is lighter and in just 5 minutes we see how to use transactions in a smarter and more flexible way! Ready!           SQL Server, such as Oracle and others RMDBS, allows you to associate a name with a transaction and even allows to you to perform a partial rollback!  If you think about it, having the ability to open a transaction and at the end of a procedure to commit or rollback alltogheter is a bit limiting . For example, in case you have to go back to the beginning of the whole procedure, which may be very long.   Between Save Transaction and Partial Rollback SQL Server provides this two commands:  SAVE TRANSACTION transaction_name ROLLBACK TRANSACTION transaction_name   Where transaction_name is the name of the transaction. Wi...