Question

My main question is how to copy a whole database having a English collation to one having a Greek collation? The source database is having all the tables and the related data. I have a clean Greek collation database. I want to copy everything from source to destination.

One solution that I found in a KB article, consisted of the following steps:

  • Generating scripts for all the objects (not including the indexes, the triggers, the primary keys, the foreign keys, the default settings, and the constraints) in the source database. Here, the Script collation setting was set to False, so the scripts were created without the collate keyword.
  • Running the scripts from step 1 on the destination database to create the objects with the destination database collation.
  • Using DTS to transfer the data from the source database. This is where I am stuck right now.

I used the Export Data... wizard of SQL Server 2005 for exporting data from source to destination database. I am having approximately 1500 tables in my database, so I ticked the Optimize of many tables checkbox in the wizard step. Apart from that, all the settings were default.

I got an error (text-file containing the report) while executing the export.

SSIS Error
(source: googlepages.com)

For moving ahead, either I need a solution to this error, or a new way to copy from source to destination database with a different collation.

EDIT 1

I forgot to mention that I've already tried to use SQL Compare. I have been using that tool since very long. But it won't help a bit in this situation. I am having tables with Latin1_General_CS_AS collation in the source database, but I DON'T want to create the tables with that collation. I know there's an option to Ignore Collation. But then, there's another problem with column names - some column names are weird, and SQL Compare introduces extra [ or ] characters while formatting column names, which breaks the WHOLE sync script!

Was it helpful?

Solution

In the past to change to collation of a database I have used Red Gate SQL Compare. They let you download a trial version of the software which I think is fully functional.

Follow these steps below and you should have your new database up and running in no time.

  1. Load up SQL Compare
  2. Input the old database Server, username, password and database name on the left
  3. Input the new database Server, username, password and database name on the right
  4. Click "Compare now"
  5. In the comparison window check everything you want moved over to your new database is checked
  6. Click "Synchronization Wizard..." this will walk you through 3 or 4 steps making sure the move over to the new database uses the correct method and any depencancies you may have missed.
  7. On the 4th screen you will see a Synchronize button. If you're happy with all your selections click it and this will move the database Schema over to the new Database.

Now you have the data schema over in the new database you need to repeat the process in SQL Data Compare You should find this quite straight forward as the process and screens are almost the same as in the steps above.

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top