• did I miss something ???

    or there are more than 2 failures ...

    select db_id('dbdb')

    -- and the second one

    select object_id('dbdb')

    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 msdn

    http://msdn.microsoft.com/en-us/library/ms190328.aspx

    it says

    OBJECT_ID Returns the database object identification number of a schema-scoped object.

    It would return NULL ..

    so the query

    USE master;

    GO

    IF OBJECT_ID('DBDB') IS NULL CREATE DATABASE DBDB

    -- it should be IF DB_ID('DBDB') IS NULL CREATE DATABASE DBDB

    GO

    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..

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm: