title: Cannot resolve the collation conflict between temp table and sys.objects
body: <p>The following T-SQL code:</p>
  <pre><code>CREATE TABLE #exclude(name VARCHAR(256))
  INSERT INTO #exclude VALUES('someprefix_someprocedure')
  
  SELECT 'someschema.' + sys.objects.name
  FROM sys.objects
    LEFT JOIN #exclude ON sys.objects.name = #exclude.name
  WHERE sys.objects.name LIKE 'someprefix_%'
    AND type IN ('FN', 'TR', 'P')
    AND #exclude.name IS NULL
  ORDER BY sys.objects.name ASC
  </code></pre>
  <p>Returns this error:</p>
  <blockquote>
  <p><strong>Msg 468, Level 16, State 9, Line 4</strong></p>
  <p>Cannot resolve the collation conflict between <code>Danish_Norwegian_CI_AS</code> and <code>SQL_Latin1_General_CP1_CI_AS</code> in the equal to operation.</p>
  </blockquote>
  <p>I tried appending this to the query, but it still returns the same error:</p>
  <pre><code>COLLATE SQL_Latin1_General_CP1_CI_AS ASC
  </code></pre>
  <p>How can I fix this?</p>