Databases and Version Control

February 24, 2008

When you are working on a software project, a Version Control System is typically used to keep track of the source code files and their changes.

But what do you do with the database related to the project?

It would be necessary to script the database schema, the changes since the previous version, as well as all the magic content that your application relies on.

Jeff Atwood over at Coding Horror (blogrolled right now) reminds us to get the database under version control, too. This post deals with versioning database change scripts. Here is a strategy to write idempotent change scripts to update your database from one version to the next.

Read the rest of this entry »


Case sensitive comparison in SQL Server

February 23, 2008

SQL Server compares strings without regard to case, which is a good thing most of the time, but can sometimes be annoying.

Luckily I found this article on case-sensitive string comparison, which gives a good overview of the possibilities:

  • cast the string to VARBINARY(length)
  • use COLLATE to specify a case-sensitive collation
  • calculate the BINARY_CHECKSUM() of the strings to compare
  • change the table column’s COLLATION property
  • use computed columns (implicit calculation of VARBINARY)

I chose the COLLATE SQL_Latin1_General_CP1_CS_AS method to perform the queries I needed.

Unsearchable MS error messages

February 12, 2008

A friend asked me to have a look at a USB harddisk which cannot be accessed anymore.

I plug it into my PC, try chkdsk g:, and get the message:

Der Typ des Dateisystems ist NTFS.
Version und Status des Datenträgers konnten nicht festgestellt werden. CHKDSK wurde abgebrochen.

Try to google the phrase, or use MSDN if you prefer, and receive… NOTHING.

Now wouldn’t you expect all the funny messages that Windows (or *any* operating system, for that matter) generates, to be searchable on the web? Plus statements by the respective manufacturer about their meaning and possible solutions?

I mean, the time is, uhm, 2008!

Featured Posts

February 1, 2008

An explanation of C# 3.0 Anonymous Types

On creating a custom QueryString based on Request.QueryString

On EeePC as a Developer’s PC

For database developers, there are a couple of tools to compare database schemes: SQLSchema and SqlCompare.