TV 프로그램에서 팀 데이터베이스를 만들려고합니다. 하지만 데이터를 넣고 tblShowteam
에 삽입하면 다음 오류가 발생합니다. 같을 것이다msg 2627 PRIMARY KEY 제약 조건 위반
Msg 2627, Level 14, State 1, Line 2
Violation of PRIMARY KEY constraint 'PK__tblShowt__F693078C03317E3D'. Cannot insert duplicate key in object 'dbo.tblShowteam'.
테이블
-- tabbellen aanmaken
create table tblShow(
setId int,
Datum date,
teams int
primary key (setId));
create table tblShowteam(
SetId int,
datum date,
teams int,
primary key (teams));
create table tblTeam(
TeamId int,
Coach varchar(35),
CoachId int,
teams int
primary key (CoachId));
-- participant table
create table tblDeelnemer(
DeelnemerId int identity(1, 1),
DeelnemerV varchar(35),
deelnemerT_V varchar(10),
DeelnemerA varchar(35),
CoachId int,
datum_optreden date
primary key (DeelnemerId));
--table for the public viewers
create table tblKijker(
Kijkerv varchar(35),
KijkerT_V varchar(10),
KijkerA varchar(35),
Stoelnummer int identity(1,3),
ShowId int Not null,
Email varchar(35)
primary key (Email));
내 삽입 :
insert into tblShowteam values (1, '2014-06-28', 1)
insert into tblShowteam values (2, '2014-06-05', 1)
insert into tblShowteam values (3, '2014-06-12', 1)
insert into tblShowteam values (4, '2014-06-19', 1)
insert into tblShowteam values (5, '2014-06-26', 1)
다른 모든 삽입 (diffrent 테이블)는 정상처럼 작동합니다.
내가 여기서 뭐하는거야?
@Ben 나는 쇼 목록에서 임의의 쇼를 골랐습니다. (질문을 수정합니다) –