title: Unique keys in N:M Relation SQL Server & C#
body: <p>I have a table called <code>cars</code> and one called <code>roads</code></p>
  
  <pre><code>Roads:                        Cars:
  
  Name      Road_Id             Owner     Car_Id
  -------------------           ---------------------
  roade45       1               Hugo        1
  roade20       2               Eson        2
  roade10       3               Karl        3
  </code></pre>
  
  <p>I need to create an N:M relation between these (one can can drive on many roads, one road can have many cars).</p>
  
  <p>It is a dumb example, but it <strong>needs</strong> to be an N:M relation.</p>
  
  <p>I do this relation by creating an other table called <code>cars_roads</code> with these columns</p>
  
  <pre><code>Road_id | Car_id | uniqueValue 
  </code></pre>
  
  <p>My problem is now that I have no idea on how to get the <code>uniqueValue</code> to take form, this value will be used to prevent doubles from occurring, eg. the same car is added to the same road a second time.</p>
  
  <p>My table is created using this code:</p>
  
  <pre><code>CREATE TABLE [dbo].[Tbl_cars_roads] 
  (
      [Road_id]   INT NOT NULL,
      [car_id] INT NOT NULL,
      CONSTRAINT [PK_Tbl_Road_id] FOREIGN KEY ([Road_id]) REFERENCES [dbo].[Tbl_Cars] ([Road_id]),
      CONSTRAINT [PK_Tbl_car_id] FOREIGN KEY ([car_id]) REFERENCES [dbo].[Tbl_Roads] ([car_id])
  )
  </code></pre>
  
  <p>How can I add an <code>uniqueValue</code> key and make it work as explained to this code?</p>