SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in


I setup an announcement for today (Sept 14) that the Sept CTP for SQL Server 2005 was released and that Database Mirroring is disabled. It's also got more language support and a few other things.

Apparently, however, my coding skills were a bit challenged. I forgot a primary rule in working with data, especially outside of SQL Server.
      x > "10" does not equal x > 10

I setup a time check based on the current time and a number I was checking, but I used the first expression, which is a string comparison expression. So "2", "3", etc. are all > "10". Only "1" would be less. So the article text got released a little early and hopefully MS isn't too upset :(

I've gotten so used to working with SQL Server data and I always check the time values when working with dates. In VBScript, however, it's a little more complicated. I should have used the CINT() function to ensure I was comparing a numerical value and then comparing that to a numeric, 10, not "10".

The Voice of the DBA

Steve Jones is the editor of SQLServerCentral.com and visits a wide variety of data related topics in his daily editorial. Steve has spent years working as a DBA and general purpose Windows administrator, primarily working with SQL Server since it was ported from Sybase in 1990. You can follow Steve on Twitter at twitter.com/way0utwest


No comments.

Leave a Comment

Please register or log in to leave a comment.