In SQL Server, I already created a table called tblDatabase with some columns. I want to add a primary key on the two columns DatabaseName and Servername.
I tried to add:
ALTER TABLE tblDatabase ADD CONSTRAINT pk_DatabaseServer
PRIMARY KEY (DatabaseName, ServerName)
in check constraints but I get pop up error that say
error validating constraint 'ck_tblDatabase'.
Did I miss something?
I also have ServerName as PK in tblServer that already relationship with tblDatabase. Is that the reason why?