Home Forums SQL Server 2005 T-SQL (SS2K5) IF table exists, DROP TABLE then CREATE TABLE - script not working RE: IF table exists, DROP TABLE then CREATE TABLE - script not working

  • Abu Dina (11/4/2013)


    You don't need to include the schema name when you call the OBJECT_ID function:

    OBJECT_ID(N'dbo.mtzcus_2014_CoreMenuAuditDetails', N'U')

    should be just

    OBJECT_ID(N'mtzcus_2014_CoreMenuAuditDetails', N'U')

    That's incorrect. You should include the schema name when you call the OBJECT_ID function although you don't have to.

    The SQL Guy @ blogspot[/url]

    @SeanPearceSQL

    About Me[/url]