>>Hi everybody,
>>
>>Is there a way to check, if the database exists? I know, how to do it for tables, but what about databases?
>>
>>Thanks.
>
IF EXISTS ( SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
> WHERE catalog_name = 'master' )
> PRINT 'Yes'
>
Interesting. In the time you answered I found the info in the Master database SysDatabases table. Is your way better?
And where do you reference my database name?
If it's not broken, fix it until it is.
My Blog