I have two tables:
CREATE TABLE InmarsatZenith.dbo.ClientJob
(JobRef int PRIMARY KEY NOT NULL,
IntRef uniqueidentifier,
CopyDeadline datetime,
PublicationDate datetime,
Repeat bit,
BusinessType nvarchar(25),
Sector nvarchar(30),
Lang nvarchar(15),
Format nvarchar(25),
CreativeRotation nvarchar(50),
TipinType nvarchar(25))
and
CREATE TABLE InmarsatZenith.dbo.Comment
(ID int identity PRIMARY KEY NOT NULL,
IntRef uniqueidentifier,
CreatedDate datetime,
ModifiedDate datetime,
CreatedBy nvarchar(25),
ModifiedBy nvarchar(25),
Comment text)
I want to be able to create multiple "Comments" that all link back to the ClientJob table based on the "IntRef" field. So essentially everytime a comment is made, the INTREF of the ClientJob is specified and then when I pull back all of the details from the ClientJob table, all of the comments come with it to. I have tried setting up a relationship between the two tables, however SQL Server states that the Primary Key is not The IntRef field in the ClientJob table and thus I cannot link the Comments table to it. Is there a way that I can have multiple Primary keys in the ClientJob table?! Or another more efficient way of doing this altogether. The relationship is "1 ClientJob has MANY Comments".
Help greatly appreciated,
Kind regards.