UNIQUE CONSTRAINT eller UNIQUE indeks. Enten vil gøre det.
ALTER TABLE dbo.MyTable WITH CHECK ADD
CONSTRAINT UQ_MyTable_BookTitle UNIQUE (BookID, Title)
eller
CREATE UNIQUE INDEX IXU_MyTable_BookTitle ON dbo.MyTable (BookID, Title)
UNIQUE CONSTRAINT eller UNIQUE indeks. Enten vil gøre det.
ALTER TABLE dbo.MyTable WITH CHECK ADD
CONSTRAINT UQ_MyTable_BookTitle UNIQUE (BookID, Title)
eller
CREATE UNIQUE INDEX IXU_MyTable_BookTitle ON dbo.MyTable (BookID, Title)