• Some weeks ago I had this issue. I used table variables to solve a problem. They were great until requirements changed and the code had to be adapted to deal with larger record sets. That's when I tried an failed to index the table variables. In the end I I used temp tables.

    BTW gali, no malice intended with my previous comment. I do appreciate your knowledge just take chill pill. Great tip about the primary key constraint. Cheers

    ---------------------------------------------------------

    It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
    David Edwards - Media lens[/url]

    Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
    Howard Zinn