December 7, 2016 at 8:17 am
Hi All,
Can this be done on sql server.
update mytable
set my column = myvalues;
rollback;
December 7, 2016 at 8:26 am
You have to begin a transaction
BEGIN TRANSACTION
...
COMMIT/ROLLBACK
Find this reference useful - https://msdn.microsoft.com/en-us/library/ms188929.aspx
Igor Micev,My blog: www.igormicev.com
December 7, 2016 at 8:26 am
The best way to find out is to try it, of course. If you did, you'd get a message saying that the ROLLBACK has no corresponding BEGIN TRANSACTION, which, I think, should answer your question.
John
December 7, 2016 at 8:39 am
Than means if i did an update I can not rollback if i did not specify that Begin Transaction.
December 7, 2016 at 8:48 am
That's right - unless IMPLICIT_TRANSACTIONS is ON for your connection. It's not the default, so it's unlikely to be on unless you consciously set it to be.
John
December 13, 2016 at 11:24 pm
This was removed by the editor as SPAM
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply