3
, 나는 외래 키이 이미 SQL 서버 2014에서
ALTER TABLE tblPerson
ADD CONSTRAINT tblPerson_Gender_FK
FOREIGN KEY(Gender) REFERENCES tblGender(ID);
을 만들고 싶었 데이터베이스에 'tblPerson_Gender_FK'라는 이름의 객체이다 그러나 나는 항상이 오류가 발생합니다 :
Msg 2714, Level 16, State 5, Line 30
There is already an object named 'tblPerson_Gender_FK' in the database.Msg 1750, Level 16, State 0, Line 30
Could not create constraint or index. See previous errors.
이가 내 테이블
create table tblPerson
(
ID int Primary Key NOT NULL,
Name varchar(max) Not null ,
Email varchar(max) Not null,
Gender int
)
다른
,536,create table tblGender
(
ID int not null Primary key,
Gender varchar(max)
)
'tblPerson_Gender_FK'라는 이름의 개체가 이미 있다는 오류는 데이터베이스에서 테이블 관계를 확인합니다. –