Code:
CREATE TABLE [UsersRoles_MAP]
(
[tab][user_id] int NOT NULL FOREIGN KEY REFERENCES [Users]([id]),
[tab][role_id] int NOT NULL FOREIGN KEY REFERENCES [Roles]([id]),
[tab][red]CONSTRAINT UNIQUE ([user_id], [role_id])[/red]
)
What is the syntax to make sure a combination of role_id and user_id is unique?
I never tried this before, and the code in red, does not work.