Reputation: 105
I have one question, I was trying to find more information on the internet but, I'm still not sure about it.
If I have a SQL Server instance with the following default Collation example "Modern_Spanish_CI_AS" and I also have a restored databse with different collation example "Latin1_General_CI_AS".
What collation SQL Server will use? by default the Modern_Spanish... or it will use from database Latin1_General?
In the follwing link explains something about it Setting and Changing the Server Collation
Thanks!
Upvotes: 2
Views: 1729
Reputation: 3372
SQL Server collations can be set at various levels: server, database, column, expession. If you do not set a collation at a lower level it is inherited from the level above. E.g. when creating a database the database collation will be the server's collation unless you explicitly set a collation for the DB.
And many collations will work together fine. Occasionally there can be difficulties, often of the nature of sort order being unexpected. I do not know for sure but I would expect the 2 you specify to be compatible.
So yes, your DB will (almost certainly) restore with the Latin1_General_CI_AS collation and almost certainly be fine. There is a list of compatible collations which Google should be able to help you find.
Upvotes: 3
Reputation: 3705
It will use the Latin1_General_CI_AS collation, as that's what's set in the database itself.
For clarification, whatever's set in the database will override the "default" collation for the server. The default collation is basically only used when you create a brand new database.
Changing the default collation at the server level has no effect on existing databases, you would have to change each collation individually, though that in itself will probably cause you cascading issues with any other database level objects you've created, such as stored procedures, constraints and even any dynamic SQL you're executing against the database from 3rd party applications.
Upvotes: 3