Creating a Primary Key on a temp table - When?

后端 未结 9 680
一个人的身影
一个人的身影 2020-12-29 04:16

I have a stored procedure that is working with a large amount of data. I have that data being inserted in to a temp table. The overall flow of events is something like

9条回答
  •  误落风尘
    2020-12-29 04:50

    You may as well create the primary key before the inserts - if the primary key is on an identity column then the inserts will be done sequentially anyway and there will be no difference.

提交回复
热议问题