• Use Query Analyzer to look at the execution plan for the statement when you pass in a variable and when you provide the value direct. If you have multiple indexes on a table, I've found that the optimizer can choose the wrong one when querying using a variable. If that's the case you can use an index hint to dictate which index should be used.