UNIQUE CONSTRAINT nebo UNIQUE index. Buď bude stačit.
ALTER TABLE dbo.MyTable WITH CHECK ADD
CONSTRAINT UQ_MyTable_BookTitle UNIQUE (BookID, Title)
nebo
CREATE UNIQUE INDEX IXU_MyTable_BookTitle ON dbo.MyTable (BookID, Title)
UNIQUE CONSTRAINT nebo UNIQUE index. Buď bude stačit.
ALTER TABLE dbo.MyTable WITH CHECK ADD
CONSTRAINT UQ_MyTable_BookTitle UNIQUE (BookID, Title)
nebo
CREATE UNIQUE INDEX IXU_MyTable_BookTitle ON dbo.MyTable (BookID, Title)