I have a query like this:
IF EXISTS(select name from sys.databases where name = 'AdventureWorks')
use AdventureWorks
I want to use AdventureWorks if it already exists, but if it doesn't exists, I want to create the AdventureWorks database.
Help me please.