• ....

    SELECT AA.*

    FROM @T AA,

    @T_INPUT BB

    WHERE AA.NAME=BB.NAME

    ORDER BY BB.ID

    Here I will play J.CELKO: Mate, you should really learn how to use ANSI standard JOINS...

    _____________________________________________
    "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]