The following code will list all existing databases on the server
//[JScript]
function Test1()
{
var cmd = ADO.CreateADOCommand();
cmd.ConnectionString = "Provider=SQLOLEDB.1;Data Source=MY-PC\\SQLEXPRESS;user id=MY_LOGIN;pwd=MY_PASSWORD;Integrated Security=SSPI;";
cmd.CommandText = "EXEC sp_databases";
cmd.CommandType = cmdText;
var rs = cmd.Execute();
rs.MoveFirst();
while(!rs.EOF)
{
Log.Message(rs.Fields("DATABASE_NAME").Value);
rs.MoveNext();
}
}
All you need to do is to get a list of all databases before your application create a new one, then once again after it and compare results :)
The difference will be a new created database.
And you need to use a correct command line to your server, of course