Create databse with case sensitive collation

  • Hi,

    I need to create a database automatically from a setup procedure. I need it to have the same collation as the server (i.e default) except for the case sensetivity i.e, somecollation_CI_AS --> somecollation_CS_AS.

    What is the best and simplest way to do it?

    Thanks

  • Hi,

    Try the following functions:

    select serverproperty('collation') --to get your server's collation

    SELECT *

    FROM ::fn_helpcollations() -- might also be useful. it returns all of the collations with a description.

     

    Once you have your server's collation you can derive the collation you want for your new database and then when you use the CREATE DATABASE statement specifiy the collation with the COLLATE option.

    Hope that helps

  • Thanks!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply