• While you can set some basic constraints on a table variable you cannot delcare indexes per se, and from my experience the unique or PK constraints don't seem to help query performance the way that an index on a table would.

    From BOL "Indexes cannot be created explicitly on table variables, and no statistics are kept on table variables."

    Without statistics, the PK or unique constraints cannot be used by the optimizer to boost query performance.

    /*****************

    If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek

    *****************/