Using CREATE DATABASE either with SQL Widget or AdvancedQuery Forge Component

Using CREATE DATABASE either with SQL Widget or AdvancedQuery Forge Component

  

Hi Community,

I have a use case where I would like to create a copy of a database possibly onto another server (MSSQL)(Schema and data) from within my Outsystems App using a script. However if I issue a CREATE DATABASE statement I get a "CREATE DATABASE statement not allowed within multi-statement transaction" error in my screen action. I've tried issuing a "CommitTransaction" server action prior to running the SQL, but to no avail. 

I've also tried using AdvancedQuery extension ExecuteCommand but this also causes problems (The database doesn't get created). I've read that a screen action wraps all SQL in a transaction, so it may not be possible.

Any ideas gratefully received.

Andy.

Solution

Solved - I didn't put the Connection_Name field in the AdvancedQuery extension. All now working fine.

Andy.

Solution