반응형
-- 테이블에 존재하던 기존 PK 삭제
ALTER TABLE dbo.myTableName DROP CONSTRAINT dbo.myTableName.pkName

-- 테이블에 새로운 PK추가
ALTER TABLE dbo.myTableName ADD CONSTRAINT dbo.myTableName.pkNewName PRIMARY KEY CLUSTERED (
    [col1] ASC,
    [col2] ASC,
    [col3] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) 
ON [PRIMARY]
 
반응형

+ Recent posts