在表中,想把其中2列或多列做爲組合主鍵。ide
CREATE TABLE [dbo].[T3] ( [col1] NVARCHAR(10) NOT NULL, [col2] NVARCHAR(10) NOT NULL, [col3] NVARCHAR(10) NULL, [col4] NVARCHAR(10) NULL ) GO ALTER TABLE [dbo].[T3] ADD CONSTRAINT [PK__T3__0000000000000003] PRIMARY KEY([col1],[col2]) GO