Solved

change Collation

Posted on 2004-08-01
7
866 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
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 

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 125 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
I have a large data set and a SSIS package. How can I load this file in multi threading?
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…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now