Can you roll back the ddl statement in a trigger?



Can you roll back the ddl statement in a trigger?..

Answer / Sunny Devkumar Singh

In SQL Server, you cannot directly roll back DDL statements within a trigger. However, you can work around this by using Transactions to enclose your DDL statements and T-SQL error handling (TRY-CATCH) blocks to handle errors and rollback the transaction when an error occurs.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Give some Scenario for Non Clusterd index? Can we write system defined functions in side The Function? Wat is the Unique Datatype?

1 Answers   Value Labs,


Which language is supported by sql server?

1 Answers  


List the different normalization forms?

1 Answers  


What is difference between aggregate and analytic function?

1 Answers  


How to concatenate two strings in SQL Server.

1 Answers   HCL,


How to convert a numeric expression from one data type to another?

1 Answers  


What is it unwise to create wide clustered index keys?

1 Answers  


Can two tables share the same primary key?

1 Answers  


What is shared lock?

1 Answers  


I have a table EMP in which the values will be like this EmpId Ename Sal DeptId 11 Ram 10000 10 11 Ram 10000 10 22 Raj 20000 20 22 Raj 20000 20 33 Anil 15000 30 33 Anil 15000 30 I want to delete only duplicate Rows. After Delete I want the output like this EmpId Ename Sal DeptId 11 Ram 10000 10 22 Raj 20000 20 33 Anil 15000 30

13 Answers   DELL,


syntax and example for bitmap index in sql???

1 Answers  


What is the difference between clustered and a non-clustered index?

1 Answers   NA,


Categories