Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Changing table/column collation Expand / Collapse
Author
Message
Posted Monday, January 21, 2008 9:54 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, September 11, 2014 3:56 AM
Points: 32, Visits: 216
Hi All,

I am currently testing migrating a database from SQL 7 to SQL 2005.
Following a backup/copy/restore to the new server, the database now has a backwards compatibilty collation of SQL_Latin1_General_CP1_CI_AS.
I have changed the database itself to be Latin1_General_CI_AS but (as expected) the collation at a column level remains SQL_Latin1_General_CP1_CI_AS, so this needs changing.

I found a nifty script on this website (LM_ChangeCollation) which uses a cursor to go through all the tables and do a Alter Table Alter Column Collate.
Genius!
Except it doesn't work :-(

It appears that if you have any sort of constraint it fails with the following message:

"Msg 5074, Level 16, State 1, Line 1
The object 'MY_CLUSTERED_INDEX' is dependent on column 'my_column'.
Msg 4922, Level 16, State 9, Line 1
ALTER TABLE ALTER COLUMN my_column failed because one or more objects access this column."

So, Anyone got any advice on how to change collation on columns where you have constraints without any major pain?

Cheers!

Stu.



Post #445550
Posted Monday, January 21, 2008 11:46 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 8:23 AM
Points: 3,313, Visits: 1,069
Check the following link may be useful

http://drsql.spaces.live.com/blog/cns!80677FB08B3162E4!1333.entry



Post #445735
Posted Tuesday, January 22, 2008 2:01 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 26, 2012 5:26 AM
Points: 1,367, Visits: 1,585
Also see http://www.sqlservercentral.com/Forums/Topic443054-5-1.aspx. Same tools though. :D (of course I'm biased)

Regards,
Andras




Andras Belokosztolszki, MCPD, PhD
GoldenGate Software
Post #445769
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse