News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Name:Alex Dybenko

Location:Moscow, Russia

Monday, July 23, 2007

Like operator on Integers in SQL Server

I sometimes use Like operator on numeric fields – integer, long, for me it looks convenient to build a filter on combobox selection, where you pass % (or * for Access) for all records and specific value to show filtered records. And seems that Jet nicely handle this (or perhaps somebody has different experience?). But recently I found that in SQL server, both 2000 and 2005 versions, this is quite inefficient operation. A sample query with condition Store Like ‘1’ runs 3 seconds, and with Store = 1 – only one! Explicit casting integer to char does not help, actually SQL Server doing the same operation itself. Now I have to adjust such filtering in several applications.


Technorati tags: ,


Post a Comment

<< Home