"default collation" for a SQL Server 2000 database

Some our clients reported  “'Cannot resolve collation conflict for equal to operation'” error. As it is explained here,  it could happen if the tempdb database collation differs from the user database collation.

I was curious where "default collation" for a SQL Server 2000 database is stored - in the database itself or in master system tables.

I didn't find any good documentation for SQL Server 2000, but according to  SQL Server 2005 doc http://msdn2.microsoft.com/en-us/library/ms178534.aspx,

sys.databases view (corresponds to Master db ) has a column 

collation_name

sysname

Collation for the database. Acts as the default collation in the database.

NULL = Database is not online or AUTO_CLOSE is set to ON.

However I made a test

1.Created a new database with some Collation, different to what I have for my SQL instances.

2.Detached the database.

3. Attached the database to the another instance of SQL server.

The database default collation was the same, so it is stored in some database table, not in master database table.

BTW, unfortunetely, there is no way to change collation of tempdb without reinstalling the sql server (see discussion here)

This article is part of the GWB Archives. Original Author: Michael Freidgeim

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.