• You cannot force the order as per list in IN.

    You should consider re-factoring your query.

    One of the ways:

    SELECT t.*

    FROM @T t

    JOIN (VALUES (1,'XYZ'),(2,'AAA'),(3,'PQR')) lst(rn,name)

    ON lst.name= t.name

    ORDER by lst.rn

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]