See my previous post... Note a.user = isnull(@user,a.user) is diferent from (@user IS NULL OR @user = a.user), the first won't use indexes, the last...
ashwin, When using an index the sql requires that one side of comparison being the column with index and the other being a constant value, ie, a...
Separate names with a comma.