title: SQL Server : duplicate key from creating unique index
body: <p>I have a table of stock quotes, and dates:</p>
  
  <pre><code>StockID QuoteID QuoteDay    QuoteClose
  ---------------------------------------
  5         95    2018-01-03    1.080
  5         96    2018-01-04    1.110
  5         97    2018-01-05    1.000
  5         98    2018-01-06    1.030
  5         99    2018-01-07    1.010
  5        100    2018-01-08    0.899
  5        101    2018-01-09    0.815
  </code></pre>
  
  <p>I create a clustered index to manipulate the data but am running into duplicate key errors with the index</p>
  
  <pre><code>CREATE UNIQUE CLUSTERED INDEX MACD_IDX ON #TBL_MACD_LOOP (StockId, QuoteId)
  </code></pre>
  
  <p>Different combinations of <code>StockID</code> and <code>QuoteID</code> will result in the same output:</p>
  
  <p>For example <code>(StockID, QuoteID)</code> of <code>(5, 11)</code> and <code>(51, 1)</code> both produce an index of <code>511</code>.</p>
  
  <p>My solution is to add "-" between StockId and QuoteId.  </p>
  
  <p>Now <code>(5, 11)</code> produces <code>5-11</code> and <code>(51, 1)</code> produces <code>51-1</code>.  </p>
  
  <p>How do I combine strings with values?</p>