Monday, March 19, 2012

import data with different collation properties

Hi All,
I have to restore a database from a different collation name to my sql
server 2000 sp3.
This database has index, primary keys and so on.
After I restore the database if I try to do a relation I have an error.
Also if I try alter table with a new collation doesn't work because the
objects(index, ...)
How can I fix this? How can I import this database with my default
collation?
Tks
JohnnyYou can use COLLATE clause:
select 1
where
'Alejandro' collate SQL_Latin1_General_CP1_CS_AS = 'ALEJANDRO'
select 1
where
'Alejandro' collate SQL_Latin1_General_CP1_CI_AS = 'ALEJANDRO'
go
or you can dump the data into files, recreate your db with a new collation,
and load the data again (Uhhhh!!!).
AMB
"JFB" wrote:

> Hi All,
> I have to restore a database from a different collation name to my sql
> server 2000 sp3.
> This database has index, primary keys and so on.
> After I restore the database if I try to do a relation I have an error.
> Also if I try alter table with a new collation doesn't work because the
> objects(index, ...)
> How can I fix this? How can I import this database with my default
> collation?
> Tks
> Johnny
>
>|||Tks for you reply Alejandro,
uauuu.... It's not an easy way to change the db collation?
I tought this is an easy problem :)
JFB
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:1FF88CBD-9B30-45B1-A637-A1E7ED22D226@.microsoft.com...
> You can use COLLATE clause:
> select 1
> where
> 'Alejandro' collate SQL_Latin1_General_CP1_CS_AS = 'ALEJANDRO'
> select 1
> where
> 'Alejandro' collate SQL_Latin1_General_CP1_CI_AS = 'ALEJANDRO'
> go
> or you can dump the data into files, recreate your db with a new
> collation,
> and load the data again (Uhhhh!!!).
>
> AMB
>
> "JFB" wrote:
>

No comments:

Post a Comment