CREATE DATABASE inside a transaction with Microsoft SQL 2005

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,
Till now I am using SQL server 2000 with Microsoft JDBC SP3 for 2000.
Everything is fine.
But now I moved to SQLServer 2005 with Microsoft JDBC for 2005. But it
throws
an error "CREATE DATABASE statement not allowed within multi-statement
transaction" when our application tries to create a new DB inside a
transaction. All other DDL statements like CREATE TABLE, ALTER etc
works well inside a transaction with JDBC. We found that only CREATE

DATABASE has problem.
This problem is not there with Old JDBC driver with SQL 2000.
I know such a problem is there with SYBASE in which by default sybase
wn't allow DDL statements inside a transaction. But they provide an
option DDL_IN_TRAN or something like that. Enabling this will allow
DDL.


How I can make CREATE DATBASE work inside a transaction. Is there any
options available.


Regards
zunilp
Cordys

.



Relevant Pages

  • Re: Why Oracle does not allow rollback of DDL statements?
    ... DDL statements are executed. ... does allow rollback of DDL statements if I am not mistaken. ... concept of transaction where by a group of statements can be rolled ... When I started learning SQL Server, ...
    (comp.databases.oracle.server)
  • Re: Why Oracle does not allow rollback of DDL statements?
    ... DDL statements are executed. ... does allow rollback of DDL statements if I am not mistaken. ... There are many legitimate reasons you want to have transaction ddl, ... When I started learning SQL Server, ...
    (comp.databases.oracle.server)