Tuesday, March 27, 2012

collation problem

hi

i have a db with hebrew collation.
i now want it to be cyrillic collation.
converting the db collation - wont help.
i tried exporting data to a blank DB created with cyrillic collation -
still, no good.

what is the best way of having a DB with a certain collation so no
matter the destination DB is, the collation of all columns will be
"database default"

thanks
amosCollations are defined a the column level. Create the tables with the
correct collation and then populate them. You can alter the existing
collation with an ALTER TABLE ... ALTER COLUMN statement but you first have
to drop any indexes on the columns and then re-create them afterwards.

--
David Portas
SQL Server MVP
--|||amos (amos@.cvidya.com) writes:
> i have a db with hebrew collation.
> i now want it to be cyrillic collation.
> converting the db collation - wont help.
> i tried exporting data to a blank DB created with cyrillic collation -
> still, no good.

I don't know exactly what you did, but presumably you used some export
wizard which performs too much things behind your back. Since I always
build my databases from scripts under version control, I have no idea
how these export wizard looks like.

If you don't have scripts under version control to build from your best
bet is probably to use the scripting facility in Enterprise Manager. I
don't think you can suppress generation of collation information there.
(You can in QA, but in QA you can only script one table at a time.)
However, once you have the script, you can open it an editor and to
a Replace All on "COLLATE Hebrew_CI_AI" to remove the collation information.

Then you can create the new database. If you need to copy data, you can
use INSERT/SELECT or bulk copy. In the latter case, be sure to export to
Unicode files.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

No comments:

Post a Comment