Transactions and DDL statements

Dear Experts,

I am using SQL Server 2005. Can I have BEGIN TRANSACTION, ROLLBACK TRANSACTION etc in a batch script that has DDL statements such as
CREATE TABLE
DROP TABLE
CREATE StoredProc
DROP StoredProc ?

Thanks
vbhargav80Asked:
Who is Participating?
 
mdagisCommented:
Yes you can.
0
 
kettlechangCommented:
Begin Transaction and Rollback Transaction are for data modification DML.  CREATE TABLE, DROP TABLE CREATE are DDL.  Begin transaction and rollback transaction do not work for DDL.
0
 
mdagisCommented:
" Begin transaction and rollback transaction do not work for DDL."

Not true
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
geek_vjCommented:
>>I am using SQL Server 2005. Can I have BEGIN TRANSACTION, ROLLBACK TRANSACTION etc in a batch script that has DDL statements such as
CREATE TABLE
DROP TABLE
CREATE StoredProc
DROP StoredProc ?

Yes, you can use them with DDL Statements too. SQL Server is an RDBMS which adheres to all these operations.
0
 
vbhargav80Author Commented:
Thanks a lot to everyone who replied
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.