SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 restore database
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

psangeetha
Yak Posting Veteran

95 Posts

Posted - 04/27/2010 :  12:54:52  Show Profile  Reply with Quote
Hi friends,

I've a 2005 database DEVEL with default collation and need to change it to Latin1_General_CI_AS. But when I alter the database I get errors that there are dependencies and cannot change the collation.

So, I created a new database called DEV with collation Latin1_General_CI_AS and trying to restore the DEVEL backup onto this DEV database with restore options 'Overwrite the existing database and Preserve the replication settings'. So when the database is restored, it will still have Latin1_General_CI_AS collation. But after restoring DEV from DEVEL, the collation changes back to default in DEV database(restored). Is there a way to preserve this collation setting and then restore the database?

Thanks a lot

tkizer
Almighty SQL Goddess

USA
36845 Posts

Posted - 04/27/2010 :  12:57:50  Show Profile  Visit tkizer's Homepage  Reply with Quote
No, you will need to remove the dependencies that are causing the collation not to be accepted.

The overwrite option you select in the restore is not relevant to the collation setting.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

psangeetha
Yak Posting Veteran

95 Posts

Posted - 04/27/2010 :  13:07:22  Show Profile  Reply with Quote
Is there any way to find all those dependencies and script it may be? Currently, when I run the alter statement to change the collation it only errors out with a couple of dependencies and I get 'The query has exceeded the maximum number of error messages. Only the first 1000 messages will be displayed'.

Is it possible to disable all the check constraints in the database and change the collation?

Thanks again

Edited by - psangeetha on 04/27/2010 13:15:35
Go to Top of Page

tosscrosby
Aged Yak Warrior

USA
676 Posts

Posted - 04/30/2010 :  11:47:18  Show Profile  Reply with Quote
You won't be able to add all the constraints back as is which could lead to a compromise of your data. Check constraints are usually there for a reason. Can you live with that? Why the need to change the collation?

Terry

-- The problem with socialism is that you eventually run out of other people’s money. -- Margaret Thatcher
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000