CREATE LOGIN %%USER%% WITH PASSWORD = '%%PWD%%'
GO

CREATE DATABASE %%DB%%
ON
( NAME = %%DB%%,
    FILENAME = '/var/opt/mssql/data/%%DB%%.mdf',
    SIZE = 500MB,
    MAXSIZE = 1000MB,
    FILEGROWTH = 100MB )
LOG ON
( NAME = %%DB%%_log,
    FILENAME = '/var/opt/mssql/data/%%DB%%_log.ldf',
    SIZE = 500MB,
    MAXSIZE = 1000MB,
    FILEGROWTH = 100MB );
GO

USE %%DB%%;
GO

CREATE USER %%USER%% FOR LOGIN %%USER%%;
GO

EXEC sp_addrolemember 'db_owner', '%%USER%%';
GO
