SQL 2005 2008 collation issue - sql-server

I've been working on SQL server 2005 for a few years and i'd never come across collation issues. However i installed SQL 2008 on a virtual machine and tried to sync my 2005 database with the new 2008 server using Redgate SQL compare. It failed complaing about the collation on the 2 servers being different.
After a quick bit of research i discovered my 2005 is using Latin1_General_CI_AS and the new 2008 installation is using SQL_Latin1_General_CP1_CI_AS.
Why is 2008 using something different to 2005? Both times i've just done a default install. Secondly what should i do to get them the same, which collation is the correct one?

I do not know what criteria is used for the MS SQL Server installer to select default collation.
Collation of a server does not have to be the same as the collation of a database on that server. Collation of a database does not have to be the same as the collation of table columns in the database.
You can set the collation of the database when you create one. Default it will get the same collation as the server.
Here is a post about how you can change the collation of a database including changing the collation of columns.
Changing SQL Server Database sorting
with a reference to here http://support.microsoft.com/kb/325335.
Here is a starting point if you need to change the default collation of a server
http://msdn.microsoft.com/en-us/library/ms179254.aspx.
I do not know what is necessary for Redgate SQL Compare, but I guess it only needs the database collation to be the same. So if you are replicating a db to a new server you probably only need to create the new db with the same collation as the one you already have and leave the default collation of the server as is.

Related

How to change the collation in SQL Server 2016?

Our database has a collation of SQL Latin General CI_AS, we need to change it to SQL Latin General CS_AS.
Is there a way to change the collation without rebuilding the database?
Maybe can we change the collation for specific tables?

Why collation problem when database and SQL query use the same?

I have SQL Server 2014 Express edition installed on a Portuguese Windows 10 computer. I have a database that was created on an US computer. I have changed the collation of the database in SSMS. I examine tables, stored procedures, etc and they all have the default collation of SQL Server (Latin1_General_CI_CA).
When I try to execute a stored procedure in the database, SQL Server barfs up a collation mismatch between Latin1_General_CI_AS and SQL_Latin1_CP1_CI_AS. I have checked everything that I know of and the collation matches.
Really hoping to avoid rewriting all my stored procedures to set the default collation.
Anyone have any ideas?
Thanks in advance.

Using the same database on different versions of SQL Server

We have several SQL Server databases at work and we plan to keep all of them in a Database Server. However, while we use SQL Server 2014 in some of the databases, there is also a database (let's say ABC) with the version of SQL Server 2008 R2.
The problem is that; ABC is a database originated from another company and sometimes it is updated by them using scripts, etc. So, this means that we have to go together with the version they use. As far as I know, it is possible to restore a database of version 2008 R2 in the version of 2014 but the reverse operation is not possible (to restore a database of version 2014 in the version of 2008 R2).
So, in that case what is the best way to solve this problem by using the single database (SQL Server 2014) on the same server?
You can generate database from the 2014, 2008 compatible. You can dig into the advanced option and you will find creating scripts for triggers, indexes and all dependent objects.
Generate Scripts
Choose Compatibility
Specify Data generating scripts
The server could be 2014.
You just need get SQL Server Management Studio (SSMS) version 2008 and generate backup using it.
You could have lots of SSMS versions.

Backup database ignoring collation

I state that I'm new to SQL Server.
With my company we are planning to migrate from SQL Server 2008 to SQL Server 2012 and I have this question.
The application which uses SQL Server 2008 was born as a one language application (Italian in this case) but later has been converted to a multi language application that requires UTF-8 encoded data.
So the DB server has been filled with custom "collation" clause on column, query and procedures to avoid data encoding errors.
Now we have configured a SQL Server 2012 instance with all the right collation since the start and I was wondering in how to migrate data between servers.
How can I tell the dbms to dump the data into UFT-8 and omit all those "collation" clauses?
Sorry for my bad English.

How to restore data from SQL Server 2005 in SQL Server 2000?

how can we get the restore in sql server 2000 of sql server 2005 data
You can't restore data from sql 2005 to 2000 only if you generate scripts with sql server 2000 compatibility. If you want create and restore backup can't do.
I recently found myself in a similar position on a client site. I came across an article on the MSDN SQL Server Forum (second response from top) with a detailed walk-through on this issue.
I ran into a few issues with scripting users & had to hack my way through it a little bit, but it was a great starting point for me.
I do not think this is possible. You can't go from 2005 to 2000, what you would have to do is install SQL 2005 Express then restore to that and you should be able to manage the backup from there.
If you only need the database structure you can generate scripts for the entire database.
Try this:
In the Properties window of the SQL 2005 Database you can set the compatibility level of that database to SQL 2000. Then perform the backup and then restore to SQL 2000.
If you don't want change the compatibilty level of your original database, just do a backup first and restore the database as a dummy in SQL 2005 and set that database's compatibility level.
alt text http://img411.imageshack.us/img411/8541/clipboard01lro.jpg
Use RedGate SQL Compare and RedGate SQL Data Compare to push the tables and data from SQL 2005 to SQL 2000.
You may be able to script the whole database from SQL 2000 compatibility mode, but getting the data requires something besides a backup and a restore. You could try bulk saving and bulk loading data, too...

Resources