I&#39;m trying to get SQL Server 2005 to CREATE DATABASE using twisted.  However, SQL Server won&#39;t allow you to run CREATE DATABASE within a transaction (apparently, it&#39;s not something sql server can roll back, which seems sensible).  Which means that the following code results in an error.  Is there a way to turn transactions off for a query?<br /><br />@defer.inlineCallbacks<br />def test_simple_create():<br />    try:<br />        password = &quot;xxx&quot;<br />        connection_string = &quot;Driver={SQL Native Client}; Server=(local); UID=sa; PWD=%s;&quot; % password<br />        db = adbapi.ConnectionPool(&quot;pyodbc&quot;, connection_string, cp_noisy=True)<br />        cmd = &quot;&quot;&quot;CREATE DATABASE atest<br />                    ON (NAME=atest, FILENAME=&#39;c:\temp\atest&#39;, SIZE=64MB)<br />                    LOG ON (NAME=atestlog, FILENAME=&#39;c:\temp\atestlog&#39;, SIZE=64MB)&quot;&quot;&quot;<br />        yield db.runOperation(cmd)<br />    except Exception, e:<br />        print e<br />    finally:<br />        db.close()<br />        reactor.stop()<br /><br />    <br />if __name__ == &quot;__main__&quot;:<br />    from twisted.python import log<br />    import sys<br />    test_simple_create()<br />    log.startLogging(sys.stdout)<br />    reactor.run()<br /><br /><br />===<br />2010-03-18 09:28:45-0500 [-] Log opened.<br />2010-03-18 09:28:45-0500 [-] adbapi connecting: pyodbc (&#39;Driver={SQL Native Client}; Server=(local); UID=sa; PWD=xxx;&#39;,)<br />2010-03-18 09:28:45-0500 [-] (&#39;42000&#39;, &#39;[42000] [Microsoft][SQL Native Client][SQL Server]CREATE DATABASE statement not allowed within multi-statement transaction. (226) (SQLExecDirectW)&#39;)<br />2010-03-18 09:28:45-0500 [-] adbapi closing: pyodbc<br />2010-03-18 09:28:45-0500 [-] Main loop terminated.<br />2010-03-18 09:28:45-0500 [-]