[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

change Collation

Posted on 2004-08-01
7
Medium Priority
?
877 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

656 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