Solved

change Collation

Posted on 2004-08-01
7
864 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
back end of ssas cube views or tables? 2 28
Sql query for filter 12 23
Change part of a string 2 24
SQL Query for Periods 3 0
Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
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 setup several different housekeeping processes for a SQL Server.

746 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

16 Experts available now in Live!

Get 1:1 Help Now