If DDL fails is whole transaction rolled back to sql server?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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
Krishna GaradRank #191 · 12.8K reputationPosted Apr 25, 2011, 1:39 AM EDT
Declare @conunt int
Begin Transaction T1
begin
--DDl Statement
Set @count=@@RowCount-- will set no of rows affected by ddl statement.
if(@count>0)
Commit Transaction T1
else
Rollback Transaction T1
End
End Transaction T1
may helps you.
AartiRank #2,383 · 594 reputationPosted Nov 17, 2011, 3:16 AM EST
Yes , When DDL Fails , whole transaction rollback.
for more please refer below link.
i hope it will help you more.
http://sqlserverpedia.com/wiki/Transaction_Overview
Thanks.
If this help you please mark it as accepted answer.
Dorababu MekaRank #457 · 5.5K reputationPosted Nov 17, 2011, 3:23 AM EST