검색결과 리스트
글
DataBase
2011. 8. 12. 14:21
mssql 외래키 지정 쿼리
table2 - 외래키를 지정할 테이블명
table1 - table2에 지정될 외래키를 기본키로 가지고 있는 테이블
table1 - table2에 지정될 외래키를 기본키로 가지고 있는 테이블
idx - table1기본키로 지정된 컬럼
tb1code - table2에 외래키로 지정될 컬럼
alter table table2
add constraint FK_table1_tb1code
foreign key(tb1code) references table1(idx)
tb1code - table2에 외래키로 지정될 컬럼
alter table table2
add constraint FK_table1_tb1code
foreign key(tb1code) references table1(idx)
'DataBase' 카테고리의 다른 글
mssql 테이블 복사 (0) | 2011.08.26 |
---|---|
테이블 생성 쿼리 (0) | 2011.07.21 |
select into 와 insert into select의 차이 (0) | 2011.07.01 |
mssql 유용한 내장함수 (0) | 2010.10.15 |
RECENT COMMENT