title: Collation Error
body: <p>I am using Microsoft SQL Server Management Studio. I have two databases one is the system database, which has the master database and the other one is my database called <code>CCTNS_CAS_DE_DB</code>. When I am trying to generate the reports through the tool which uses the <code>CCTNS_CAS_DE_DB</code> database. </p>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p><em>Cannot resolve the collation conflict between "Latin1_General_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation</em></p>
  </blockquote>
  
  <p>I went through the SQL Server and checked the properties of the master database it shows the collation as <code>Latin1_General_CI_AI</code> but when I went to the properties of the <code>CCTNS_CAS_DE_DB</code> database it shows the collation as <code>SQL_Latin1_General_CP1_CI_AS</code>.</p>
  
  <p>I searched for the error online but most of the solution tell how to change the collation of a particular table but I didn't come across any query which will change the collation my database to <code>Latin1_General_CI_AI</code>. </p>
  
  <p>I came across one query which is:- </p>
  
  <pre><code>ALTER DATABASE CCTNS_CAS_DE_DB COLLATE Latin1_General_CI_AI
  </code></pre>
  
  <p>When I ran this query in my SQL Server it threw the following error:-</p>
  
  <blockquote>
    <p><em>Msg 5030, Level 16, State 2, Line 1<br>
    The database could not be exclusively locked to perform the operation.<br>
    Msg 5072, Level 16, State 1, Line 1<br>
    ALTER DATABASE failed. The default collation of database 'CCTNS_CAS_DE_DB' cannot be set to Latin1_General_CI_AI.</em></p>
  </blockquote>
  
  <p>I know this question has already been posted here but that was in a different context I think.</p>