제약조건 질문입니다.

희망나라 2015.04.01 14:29 Views : 3037

Create Table Item_Master
(
barcodeKey int identity(1,1) Constraint PK_barcodeKey Primary Key Clustered

,barcode Varchar(17) null
)
Create NonClustered index IX_barcode On Item_Master (barcode)


sp_helpindex Item_master -- 인덱스 정보

IX_barcode        nonclustered located on PRIMARY barcode
PK_barcodeKey clustered, unique, primary key located on PRIMARY barcodeKey

 

Inset 1부터 9까지 (단 2은 맨 마지막 insert.)


Insert into Item_Master (barcode) values ('1' )
Insert into Item_Master (barcode) values ('3' )
Insert into Item_Master (barcode) values ('4' )
Insert into Item_Master (barcode) values ('5' )
Insert into Item_Master (barcode) values ('6' )
Insert into Item_Master (barcode) values ('7' )
Insert into Item_Master (barcode) values ('8' )
Insert into Item_Master (barcode) values ('9' )
Insert into Item_Master (barcode) values ('2' )


select * from Item_Master

 

barcodeKey , barcode

1                    1
9                    2
2                    3
3                    4
4                    5
5                    6
6                    7
7                    8
8                    9

 

barcodeKey 가 Clustered 이면

 barcodeKey 기준으로 1,2,3,4,5,6,7,8,9 순으로 나와야 하는것 아닌가요.?

 

No. Subject Author Date Views
Notice SQL강좌: 챗GPT와 함께 배우는 SQL Server 무료 강좌 목차와 소개 (2023년 9월 업데이트) 코난(김대우) 2023.08.18 42817
Notice Python 무료 강좌 - 기초, 중급, 머신러닝(2023년 6월 업데이트) 코난(김대우) 2021.01.01 22720
8643 대용량 mdf 파일 데이터베이스 연결 [7] 띠용띠요 2015.04.06 9845
8642 postgresql 에서 mssql 로 포팅을 시켜야 하는데 [1] afddsa 2015.04.04 3505
8641 트랜잭션 복제 시 배포 및 게시 강제 해제 방법을 알고 싶습니다. [1] gnome7835 2015.04.03 2616
8640 백업 및 데이타 유실 문의 드립니다. [1] 죠리퐁 2015.04.03 3221
8639 sql 2000 에서 2008 설치 하는 방법을 알고자 합니다. [6] 슈토파이터 2015.04.03 2796
8638 테이블 데이터 일괄 업데이트 방법ㅠㅜ [1] 홍야홍야 2015.04.02 3313
8637 SQL 스칼라 서브쿼리 질문입니다. [1] 프루너스 2015.04.01 3969
» 제약조건 질문입니다. [3] 희망나라 2015.04.01 3037
8635 순차적 값 채워지기 ms sql 질문입니다 [2] gugugogo 2015.04.01 3430
8634 Slot Row 크기에 대해서 [6] dontcryme 2015.04.01 3173
8633 ODBC로 비주얼베이직 연동 시키는 법 질문입니다~ㅠ [2] 어어렁 2015.03.31 3881
8632 DB LOCK현상 문의 [3] akfflr 2015.03.31 3669
8631 정말 허덥한 질문하나 드리겠습니다. [2] 우창수_296710 2015.03.30 2954
8630 select문을 컬럼으로 불러오는것과 from에 사용하는것과 어떤게 속도가 더 빠르 [4] neiyan 2015.03.30 3468
8629 필드 접근시 반응할수 있는방법. [2] 리퍼스 2015.03.27 2493
8628 프로그램을 통해 데이터 입력시 'ACTIVE_TRANSACTION'. 에러 발생 [1] 냠냠10 2015.03.27 3231
8627 조인문실행과 관련된 질문입니다. [1] 김락중_278785 2015.03.27 2470
8626 해당 에러는 왜 발생하는지 알고 싶습니다. [1] 바보쿠우 2015.03.27 3709
8625 인덱스질문 kollokollok 2015.03.27 2381
8624 간단한 쿼리 질문 입니다. [2] l1j2e3 2015.03.26 2693





XE Login