Create custom database using AddIn.sql failed with SQL error

SOLVED

Hi all,

I want to create a custom database using addIn.sql file from an Add on, so user do not have to go to MSSQL to create himself. But I have problem installing the add on because of this error:

"CREATE DATABASE statement not allowed within multi-statement transaction" which were printed twice.

Below are my create SQL query: (I would like to paste it as "Code" but unable to do so because of "You have been blocked" popup). I have try execute it in MSSQL Studio and the query is working fine.