• "Use indexes on temporary tables. Earlier days, I always forget to use a index on temporary. Specially, for large temporary tables consider using clustered and non-clustered indexes on temporary tables. "
  • Indexing temporary tables is problematic - if you create an index called idxFoo, and 2 users hit the sproc at the same time, then the 2nd user will get an "Index name already exists" type of message.  How can you create a unique index name?

    Steve