steve 50602 (1/13/2013)
If I wanted the sort order changeable via the website, then I would definitely use something like CHARINDEX, as it seems a pretty flexible solution. I'd probably just put the concatenation and CAST inside the CHARINDEX function, rather than using a CROSS APPLY.
Might be but definitely not from query performance perspective.as it doesnt get any help when you put any function on column
like WHERE left (column_name,1) = 'L' ORDER BY CHARINDEX(statusId,'32451')
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)