?
Solved

change Collation

Posted on 2004-08-01
7
Medium Priority
?
880 Views
Last Modified: 2007-12-19
Hello

how can i change the collation name of a specific database ?

The rebuildm.exe is changin the Master database while i want to change only a specific database .

is there a way to change it with sql statements like alter ?

What is the common collation name ? (I develop an application with DB  with collation of hebrew / arabic ... now i wish to change the collation to english ) how can i do it ?

Thank you
Asi
0
Comment
Question by:asi
  • 4
  • 3
7 Comments
 
LVL 9

Expert Comment

by:crescendo
ID: 11688471
You can use

    ALTER DATABASE YourDatabaseName
    COLLATE CollationName

But this will only affect tables and columns created subsequently, it won't change existing data. To do that, the easiest way is to generate the database creation script in Enterprise Manager, then find and replace all references to your existing collation with the new collation name.

First, dump all the tables using BCP.
Second, drop the database (back it up first!)
Third, recreate it using the edit script.
Fourth, reload the data using BCP.
0
 

Author Comment

by:asi
ID: 11689005
BCP ?
0
 
LVL 9

Expert Comment

by:crescendo
ID: 11689025
It's a command-line utility to import and export data to text files. Look it up in Books Online.
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 

Author Comment

by:asi
ID: 11695781
can u be more specific regarding the parametrs of BCP (in need specific sample)
0
 
LVL 9

Expert Comment

by:crescendo
ID: 11696869
To output a table:

bcp pubs..authors2 out authors.txt -w -Sservername -Usa -Ppassword

0
 

Author Comment

by:asi
ID: 11704380
and how :
1) " recreate it using the edit script" - what is edit script
2) "reload the data using BCP" - how ? sample ?

Thank you
Asi

0
 
LVL 9

Accepted Solution

by:
crescendo earned 500 total points
ID: 11704556
The edit script is obtained by going into Enterprise Manager, right-clicking on the database, selecting All Tasks, then Generate SQL Script. It gives you a full script to create the database. You need to find and replace all the references to collation.

To import a file using BCP use the opposite of the export

bcp pubs..authors2 in authors.txt -w -Sservername -Usa -Ppassword

Asi, I am concerned that you very little experience of SQL Server, and these are potentially difficult and risky procedures. You really should involve someone locally who is familiar with SQL, or you risk losing your data. We don't have the time on Experts Exchange to train people in new skills, so the answers assume a basic knowledge. Please be careful, and preferably get some help. Test these procedures on dummy data first, to make sure you understand how they work, and what you need to do.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question