對不起,如果這看起來像重複,但我無法找到我的情況的答案。我正在試圖在數據庫NBFP
中創建表cardissuedates
。SQL Server創建表給出錯誤,該對象''已經存在,當它不
這裏是我創建語句:
USE NBFoodPantry
CREATE TABLE cardissuedates
(
clientid char(36) NOT NULL,
issuedate date NOT NULL
CONSTRAINT cardissuedates
PRIMARY KEY CLUSTERED (clientid ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,
IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
我得到這個錯誤:
Msg 2714, Level 16, State 5, Line 33
There is already an object named 'cardissuedates' in the database.Msg 1750, Level 16, State 0, Line 33
Could not create constraint or index. See previous errors.
表沒有在NBFB
數據庫存在,我無法找到它,當我檢查主機和NBFB。
我已經試過
select *
from sys.all_objects
where name like '%ca%'
order by 1
select *
from sys.tables
where name like 'c%'
order by 1
select *
from sys.all_columns
where name like 'c%'
order by 1
我甚至創造了一個新的數據庫,並執行該創建語句,隨着使用的語句新的數據庫名稱。同樣的錯誤。
我已經停止退出SSMS的所有服務。似乎沒有任何工作。 我不知道在哪裏再看。
任何幫助將非常感激。
感謝
您是否嘗試過運行DROP TABLE cardissuedates確認該表不存在約束? – JammoD
錯誤是int創建的約束,而不是表格,看到我的回答如下 –