database - SQL Server (2008) Creating link tables with unique rows -


I have trouble connecting to SQL Server Management Studio 2008! I want to create a link-table that will associate the event with many audiences (event disabled).

An example of data that may include:

EventId | AudienceId

  4 1 5 1 4 2  

However, I do not want this:

EventId | Audiences ID

  4 1 4 1  

I'm looking at relationships and obstacles .. but no happiness so far!

As a second part of the question secretly, I would like to set the audience table, if the line is deleted from an audience, then this event will clear the audience link table in a broader way.

As always, appreciate any help / advice!

Thanks Pete

Just use:

  Dbo.EventAudience on unique index UQ_EventAudience (EventID, AudienceID);  

Comments