Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLServer can't create table, "Already exists", but it doesn't AFAICT

Tags:

sql-server

I am trying to create a simple table for error logging in one of my small databases. When I try to run CREATE TABLE, I get an error:

There is already an object named [thename] in the database

But there isn't. If you try to ALTER it, or DROP it, or anything else, it responds:

Cannot drop table [thename], because it does not exist...

Looking in Manager, the table does not exist. I looked in Views and all the other "folders" as well. I followed all the hints in this thread, including lots of F5's, rebooting, setting the options for the Designer, and I still have this problem.

UPDATE: for fun I simply tried a different table name - that failed the same way.

**UPDATE: **

CREATE TABLE PropBut_ERRORS 
(
    [HMY] [NUMERIC](18, 0) IDENTITY(1,1) NOT NULL,
    [sUser] [VARCHAR](255) NULL,
    [dtTimestamp] [DATETIME] NULL,
    [sPropCode] [VARCHAR](255) NOT NULL,
    [iBook] [INT] NOT NULL,
    [severity] [INT] NOT NULL,
    [message] [VARCHAR](255) NOT NULL
)

Any ideas?

like image 769
Maury Markowitz Avatar asked Jan 19 '26 21:01

Maury Markowitz


1 Answers

Based on your comments plausible explanation - you do not have permission to see all objects.

Table you are trying to create already exists in database, but you do not see it.

When you try to create it, you got There is already an object named [thename] in the database

When you try to alter or drop, you got Cannot drop table [thename], because it does not exist... But notice the rest of this error: ...or you do not have permission.

like image 95
Pm Duda Avatar answered Jan 21 '26 10:01

Pm Duda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!