Second Stanza

April 10, 2008

Resetting Collation in SQL Server 2005

Filed under: SQL Server — Tags: — dfbaskin @ 7:02 am

I accidentally installed a development version of SQL Server 2005 with a case-sensitive collation. This upset other SQL databases I was working with that were not expecting table names and etc. to be case sensitive. In SQL Server 2005, you can reset the collation by using setup with the REBUILDDATABASE parameter.

Details about this process are here.  Details about setting the collation are here.

The following command (one line) worked for me:

start /wait setup.exe /qb INSTANCENAME=MSSQLSERVER
     SQLACCOUNT=doman\user SQLPASSWORD=password

(I originally tried this from the “\Program Files\Microsoft SQL Server\90\Setup Bootstrap” directory, but this generated an error saying an .MSI file was not found. But it worked fine from the original installation media.)

However, there was a problem trying to reapply SP2 (found here). There have been additional updates since SP2 was released (described in detail here), which Windows Update had already applied. Therefore, I could not apply the SP2 updates since components were already at a later version.

From here, I assume you have two options:

  1. Uninstall SQL Server altogether, reinstall, and apply the service pack. This, of course, defeats the purpose of using the REBUILDDATABASE option in the first place.
  2. Request the cumulative service pack update (described here) and apply it.

I ended up going with the first option.

Blog at