Question : How to Change Database Collation

Hi Can anyone tell me the easiest way on how to change the database collation. I am running the following statement:

ALTER DATABASE MyDatabase COLLATE Japanese_CI_AS

but I am getting

The object 'chk_email_mntr_action' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 1
The object 'chk_relative_date_dur_unit' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 1
The column 'ufn_ppoGetUserAccessIds.chUserId' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 1
The object 'chk_scr_stp_meth_call_type' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 1
The column 'ofnspParseString.value' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 1
The object 'conGroupUserXOR' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 1
The object 'chkOnyxSemaphoreChWaitForDelay' is dependent on database collation.
Server: Msg 5072, Level 16, State 1, Line 1
ALTER DATABASE failed. The default collation of database 'prism_cognos_test' cannot be set to Chinese_PRC_CI_AS.


Sorry but I have looged a similar log before but no one has answered.....I need help its quite urgent

Many Thanks


Answer : How to Change Database Collation

Try modifying your check constraints and add the COLLATE clause.  For example, if your check constraint is like this:

chk_email_mntr_action

chk_email_mntr_action = 'A' or chk_email_mntr_action = 'D'

Change it as follows:

chk_email_mntr_action = 'A' COLLATE Japanese_CI_AS or chk_email_mntr_action = 'D' COLLATE Japanese_CI_AS

Do this for all the objects mentioned in the error message where you are comparing against a string value.  Just add "COLLATE Japanese_CI_AS" then change your database collation.
Random Solutions  
 
programming4us programming4us