Recently I “resolved” a bug. About one week later, my co-worker alerted me to an issue with my fix. The issue had to do with a t-sql statement that used an id in its where clause. I forgot to put this id in single quotes.

MS SQL Server assumed that I intended for this value to be an integer due to its lack of single quotes. As a bonus, it never generated a parsing error.

This worked most of the time. The column in the where clause was a varchar 14 characters wide. The default id format fits within an integer and is numeric(0-9).

However some customers configure their id format to be larger than an integer ( > 10 digits). This experience taught me the importance of testing with dirty, bad or troublesome data. Troublesome data saves you by exposing issues early, while “comfortable” data obscures them.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s