title: Use variable as collation (SQL Server 2008)
body: <p>I have a variable I need to use as a collation;</p>
  <pre><code>DECLARE @collat sysname;
  
  SELECT @collat = 'SQL_Latin1_General_CP1_CI_AS';
  
  MERGE ...
  USING ...
  ON (x = y COLLATE @collat)
  </code></pre>
  <p>The collation SELECT is actually some magic source which determines which collation to use.</p>
  <p>SQL Server seems to not like this throwing</p>
  <blockquote>
  <p>Incorrect syntax near '@collat'.</p>
  </blockquote>
  <p>Does anyone have any knowledge on using variables for collate?</p>
  <p>Thanks</p>