Bogus Error Droping a creating Tables

  • I have been creating tables left and right. The past two weeks I created hundreds.

    About 30 minutes ago I start getting error when I execute a drop table when the table exists, I get an error that it does not exists or I do not have permissions (sysadmin).

    When I try and Create the table even though it has been droped I get an error that it already exists even though it did not exists prior to me executing the CREATE TABLE Command in which I get the error.

    Any ideas?

    Has this happened to anyone else?

    Msg 2714, Level 16, State 6, Line 1

    There is already an object named 'ACCOUNTS_PAYABLE' in the database.

    DROP TABLE [POINT_CYP].[ACCOUNTS_PAYABLE]

    Msg 3701, Level 11, State 5, Line 1

    Cannot drop the table 'POINT_CYP.ACCOUNTS_PAYABLE', because it does not exist or you do not have permission.

    SELECT name, SCHEMA_NAME(schema_id) AS SchemaName

    FROM sys.objects

    WHERE name = 'ACCOUNTS_PAYABLE'

    Nothing is returned

    I execute a CREATE TABLE Script and I get the following error:

    Msg 2714, Level 16, State 6, Line 1

    There is already an object named 'ACCOUNTS_PAYABLE' in the database.

    I execute:

    SELECT name, SCHEMA_NAME(schema_id) AS SchemaName

    FROM sys.objects

    WHERE name = 'ACCOUNTS_PAYABLE'

    The table is there.

    I have been creating hundreds of tables over the past two weeks. Ni issues, now all of a suddent I get an error.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • could your script be multiple commands, and you are adding the same table twice?(and maybe dropping it once.

    you seem to be on the right track as far as looking at the schemas first.

    you are of course a sysadmin, so you can see every object, and not just objects you have rights too?

    does your create table script explicitly have the schema name?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • The script did not attempt to add the same table twice.

    I closed evertyhing down & logged back in and everything appreas to be normal again.

    Very wierd.

    Thanks.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply