Reply to comment

Where should I run these scripts?

Hello.
Thanks for these scripts - very simple BUT VERY USEFUL.
I opened createDB script in MS SQL Server Management Studio 2008, edited it as I need. But I couldn't execute it:
string "use [MyDatabase]" shows that this database doesn't exist. Of course it doesn't!!!
But why program hadn't created it before as it written in
"if not exists(select * from sys.databases
where name = 'MyDatabase')
begin
create database MyDatabase
end"?

Reply