Solved

change Collation

Posted on 2004-08-01
7
870 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
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.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

828 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