How to roll back a transaction ?
write a query to roll back transaction (say delete a record) in sql server 2012 ?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Midhun TpRank #388 · 6.5K reputationPosted Aug 25, 2016, 5:28 PM EDT
BEGIN TRAN
Delete from tablename where id='1';
-- if delete is what you want then
COMMIT TRAN
-- if NOT then
ROLLBACK
Please check below links for more details -
http://www.c-sharpcorner.com/UploadFile/63f5c2/commit-and-rollback-comands-in-sql-server/
http://www.codeproject.com/Questions/530141/HowplustoplusRollplusBackplusInsert-cUpdateplusan
ketan borsdiyaRank #2,258 · 624 reputationPosted Aug 25, 2016, 8:34 PM EDT
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Aug 26, 2016, 1:15 AM EDT
Vinay SinghRank #604 · 4K reputationPosted Aug 26, 2016, 1:52 AM EDT
Kavi Nithyasri39 reputationPosted Aug 29, 2016, 10:16 PM EDT