Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Problem Changing DB Collation

Author  Topic 

beanz
Starting Member

35 Posts

Posted - 2005-05-12 : 13:12:21
Hi Everyone.

I need to change the collation of a couple of databases. I am using the following script:

ALTER DATABASE [Dynamics]
COLLATE SQL_Latin1_General_CP1_CI_AS
GO

This looks as though it will work but QA returns error such as:

Server: Msg 5075, Level 16, State 1, Line 2
The object 'CK__SY04400__DATE1__06CD04F7' is dependent on database collation.

CK__SY04400__DATE1__06CD04F7 is a check constraint on one of tte tables but there are hundreds of similar constraints.

Does anyone know how I can get around this??

Cheers,
danny

bakerjon
Posting Yak Master

145 Posts

Posted - 2005-05-12 : 19:21:00
You could create a new database (DB_2) with the proper collation. Script out the objects from DB_1 in 7.0 format. Create the tables in DB_2 from the scripts just created of DB_1. DTS the data (and move the non-table objects) over to DB_2 from DB_1. Rename DB_1 to DB_1_old. Rename the DB_2 to DB_1. Test and verify.

It really does work. Don't ask how I know :)


Now I know, and knowing is half the battle!
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=48013

Go to Top of Page

beanz
Starting Member

35 Posts

Posted - 2005-05-13 : 04:02:36
Thanks for the prompt follow up!

Won't scripting out the DB script the collation too? Can the check constraints be scripted too?

Also, is this the accepted method for doing this process or are there other ways/things to consider?

Danny
Go to Top of Page

beanz
Starting Member

35 Posts

Posted - 2005-05-13 : 09:03:22
Hi,

I tried the suggested solution but I ran in to FK contraints during the DTS transfer. Do you know how I can get around that?

Danny
Go to Top of Page
   

- Advertisement -