did I miss something ???
or there are more than 2 failures ...
-- and the second one
I don't think it will return the same value for a database.
I dig a little bit on the Object_id for a reference .. and in msdnhttp://msdn.microsoft.com/en-us/library/ms190328.aspx
OBJECT_ID Returns the database object identification number of a schema-scoped object.
It would return NULL ..
so the query
IF OBJECT_ID('DBDB') IS NULL CREATE DATABASE DBDB
-- it should be IF DB_ID('DBDB') IS NULL CREATE DATABASE DBDB
it would fail, if the database already exist..
EDIT : Okay, in the question , the first query drops the database .. so , it would be fine in this Qotd , but in general.. I think it would be an information while using it in the code..
Wondering what I would do next , when I am done with this one