Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>I think this is a bug in Windows Azure SQL!</strong></p> <p>On line documentation states that you can override the collation at the database, column or expression levels. You can not do it at the server level.</p> <p><a href="http://msdn.microsoft.com/en-us/library/windowsazure/ee336245.aspx#sscs" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/windowsazure/ee336245.aspx#sscs</a></p> <p>Lets start with something we know will work, a local install of SQL Server 2012.</p> <pre><code>-- Start at master Use master; Go -- Create a new database CREATE DATABASE Koopa COLLATE SQL_Latin1_General_CP1_CS_AS; -- Use the new database Use Koopa; Go -- Create a new table CREATE TABLE [MyTable] ( [ColName1] NVarChar (4000) COLLATE SQL_Latin1_General_CP1_CS_AS NULL, [colname1] NVarChar (4000) COLLATE SQL_Latin1_General_CP1_CS_AS NULL ); </code></pre> <p>If we try to run the create table in the MASTER database, we get your error.</p> <p>Msg 2705, Level 16, State 3, Line 2</p> <p>Column names in each table must be unique. Column name 'colname1' in table 'MyTable' is specified more than once.</p> <p>If we run the create table in the Koopa database, it works fine. See image below. That is because MASTER is Case Insensitive CI!</p> <p><img src="https://i.stack.imgur.com/G1zwB.jpg" alt="enter image description here"></p> <p>I am going to use the Web Interface for Azure SQL database since it has nice colors (it is the web)!</p> <p>Let's create a new database with the Case Sensitive collation. Wow I am getting excited since there is an option to select our collation.</p> <p><img src="https://i.stack.imgur.com/PDdef.jpg" alt="enter image description here"></p> <p>Now that we have a new database, lets check the settings!</p> <p><img src="https://i.stack.imgur.com/Fa5ws.jpg" alt="enter image description here"></p> <p>I am still happy since we see the correct collation listed for the database. </p> <p>Lets log onto the database server directly and run a simple query to create the table.</p> <p>I am going to try the designer first!</p> <p><img src="https://i.stack.imgur.com/oc6St.jpg" alt="enter image description here"></p> <p>Oops, It did not work.</p> <p>Lets try a simple DDL statement in a query window.</p> <p><img src="https://i.stack.imgur.com/9U2XA.jpg" alt="enter image description here"></p> <p><strong>Now I am really disappointed.</strong> We were sold a bill of goods but Azure SQL did not deliver.</p> <p>In short, the documentation says you can not set the collation at the server level.</p> <p><a href="http://technet.microsoft.com/en-us/library/ms143726.aspx" rel="nofollow noreferrer">http://technet.microsoft.com/en-us/library/ms143726.aspx</a></p> <p>However, this Quote from BOL states we should be able to over ride it at the database level.</p> <p><em>Server-level collations The default server collation is set during SQL Server setup, and also becomes the default collation of the system databases and all user databases. Note that Unicode-only collations cannot be selected during SQL Server setup because they are not supported as server-level collations.</em></p> <p><img src="https://i.stack.imgur.com/nVAZI.jpg" alt="enter image description here"></p> <p>In short, I am extremely busy with a couple speaking engagements for PASS the next 7 days. I will have to open a bug report or see if there is one already open.</p> <p>Good find!! </p> <p>BTW - You now need to use distinct column names.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload