Redian新闻
>
How to handle inserting value to Identity column in sql server 2005
avatar
How to handle inserting value to Identity column in sql server 2005# Database - 数据库
C*r
1
帮朋友一问,朋友很早以前大学时候入过党,现在做博士后。现在通过EB1A申请绿卡。
党员那项填yes是不是很麻烦?通过率很低?一般这种情况可以填No吗?会有什么后果
吗?谢谢。
avatar
l*b
2
Hi, friends,
I have existed DB with Identity (1,1) primary key columns and it has huge
data. Now I have to insert non-auto-increment value in this primary key. Do
you have any idea on this?
avatar
k*n
3
就写没入过党,没人查的
avatar
a9
4
set xxx off?

2005
Do

【在 l*****b 的大作中提到】
: Hi, friends,
: I have existed DB with Identity (1,1) primary key columns and it has huge
: data. Now I have to insert non-auto-increment value in this primary key. Do
: you have any idea on this?

avatar
l*b
5
Do you mean SET IDENTITY_INSERT XXX ON?
Does it have any issue if I wrap it in my high volume transactions?

【在 a9 的大作中提到】
: set xxx off?
:
: 2005
: Do

avatar
a9
6
对,就是那个。我没在生产上用过,不知道。我就是在dts里用。
我也不知道手工insert以后,再自动的时候identity是几,呵呵。

【在 l*****b 的大作中提到】
: Do you mean SET IDENTITY_INSERT XXX ON?
: Does it have any issue if I wrap it in my high volume transactions?

avatar
i*a
7
Should be fine

【在 l*****b 的大作中提到】
: Do you mean SET IDENTITY_INSERT XXX ON?
: Does it have any issue if I wrap it in my high volume transactions?

avatar
l*b
8
I have another approach to change the PK column Identity (1,1) to non-auto-
increment. It looks like I have to create some temp columns or tables to
copy/remove/rebuilt the PK column. Do you think I could have other way to go
? Thank you.
avatar
i*a
9
are you trying to do this while the DB is live and busy?

auto-
to go

【在 l*****b 的大作中提到】
: I have another approach to change the PK column Identity (1,1) to non-auto-
: increment. It looks like I have to create some temp columns or tables to
: copy/remove/rebuilt the PK column. Do you think I could have other way to go
: ? Thank you.

avatar
l*b
10
Hi, iMaJia, yes, I want to test if it is feasible. But I am afraid of the
performance and the role issue (need DDLadmin role as least). Do you have
other concern?
Otherwise, I have to change the PK column totally with clone/drop/rebuild.

【在 i****a 的大作中提到】
: are you trying to do this while the DB is live and busy?
:
: auto-
: to go

avatar
i*a
11
that maybe a problem if you have concurrent inserts into the database
from different sources.
the auto ID will insert as the next biggest number in the column. so if
you manually set indentity_insert xxx off and adds a row of ID 1000,
next auto insert will be 1001. and when you process your manual row of
1001, you'll get the error.
one way to avoid this, that I can think of now is, reserver a gap for
yourself.
say your current ID is 1 - 1000, and you need to manually insert 500
records. reseed t

【在 l*****b 的大作中提到】
: Hi, iMaJia, yes, I want to test if it is feasible. But I am afraid of the
: performance and the role issue (need DDLadmin role as least). Do you have
: other concern?
: Otherwise, I have to change the PK column totally with clone/drop/rebuild.

avatar
i*a
12
as for performance, do it in small batches to avoid big impact on the live
activity

the
have
clone/drop/rebuild.

【在 l*****b 的大作中提到】
: Hi, iMaJia, yes, I want to test if it is feasible. But I am afraid of the
: performance and the role issue (need DDLadmin role as least). Do you have
: other concern?
: Otherwise, I have to change the PK column totally with clone/drop/rebuild.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。