title: Changing DB Collation in VS2010 DB Project
body: <p>I have a DB project in SQL Server 2008 R2.  I have a table within this project, e.g.:</p>
  
  <pre><code>CREATE TABLE [dbo].[MyTable](
      [IDField] [int] IDENTITY(1,1) NOT NULL,
      [AnotherField] [int] NULL,
      [StrangeBehaviour] [varchar](50) NULL,
   CONSTRAINT [PK_MyID] PRIMARY KEY CLUSTERED 
  (
      [IDField] ASC
  ) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
  </code></pre>
  
  <p>The table script looks like this.  When I deploy the project using vsdbcmd.exe it creates / updates the table as expected.  </p>
  
  <p>However, in SSMS in the object explorer, if I select the table column "StrangeBehaviour" on the target DB and select Properties or Modify then I see that the collation is being set to something other than the DB default (the default being Windows Collation -> Latin1_General.  This is then set to a seemingly random windows collation.</p>
  
  <p>If I script the table as "Insert To" in SSMS then I don't see the changed collation.</p>
  
  <p>I therefore have two questions:</p>
  
  <ul>
  <li><p>I was under the impression that the upgrade script was based on the SQL inside the DB project - is this not the case and, if not, how do I access the additional data?</p></li>
  <li><p>How is this property held in the target database when none of the scripts seem to reference the changed collation?</p></li>
  </ul>