March 12, 2019 at 10:38 am
I am trying to add a table to my database, but it says it already exists.
I am using MSSMS and the script I am using is below:-- =========================================
-- Create table template
-- =========================================
USE Verses_Find
GO
CREATE TABLE CSize
(
CID INT IDENTITY(1,1) NOT NULL,
BoxX Float NOT NULL,
Cellw INT NOT NULL,
Cellh INT NOT NULL,
Size varchar(9) NOT NULL,
floatx Float NOT NULL,
floaty INT NOT NULL,
floatw INT NOT NULL,
floath INT NOT NULL,
ort varchar(1) NOT NULL,
Narative varchar(70) NOT NULL,
CONSTRAINT CSize PRIMARY KEY (CID),
)
GO
I have looked through every database on my server and there is no table that name.
Whats causing this error?
March 12, 2019 at 10:42 am
Your primary key constraint name is the same as your table name.
Change it to: CONSTRAINT PK_CSize PRIMARY KEY (CID),
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply