Home > Archive > MS SQL Server > December 2005 > Restore Collation Change









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Restore Collation Change
Joe L

2005-12-28, 9:23 am

Using SQL Server 2005.

When I restore a database it changes the collation setting for the new
database. I am simply backing up and restoring the DB with a new name to
the same server for comparison purposes.

The new database has the collation of the server.

Is there a way to restore and preserve the collation setting?




Tibor Karaszi

2005-12-28, 1:23 pm

That should not happen, it should be impossible. How do you determine the collation of the restored
database? Below scrip show that a restored database will keep the collation:

CREATE DATABASE x COLLATE Albanian_BIN
GO
SELECT name, collation_name from sys.databases where name = 'x'

BACKUP DATABASE x TO DISK = 'C:\x.bak' WITH INIT
GO
RESTORE FILELISTONLY FROM DISK = 'c:\x.bak' WITH FILE = 1
GO
RESTORE DATABASE y FROM DISK = 'C:\x.bak'
WITH
MOVE 'x' TO 'c:\x.mdf'
,MOVE 'x_log' TO 'c:\x.ldf'
GO
SELECT name, collation_name from sys.databases where name IN('x', 'y')


--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/

Blog: http:// solidqualitylearning
.com/blogs/tibor/



"Joe L" <jjj@lll.com> wrote in message news:ueRjgD8CGHA.4004@tk2msftngp13.phx.gbl...
> Using SQL Server 2005.
>
> When I restore a database it changes the collation setting for the new database. I am simply
> backing up and restoring the DB with a new name to the same server for comparison purposes.
>
> The new database has the collation of the server.
>
> Is there a way to restore and preserve the collation setting?
>
>
>
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com