Redian新闻
>
a simple question about T-SQL
avatar
a simple question about T-SQL# Database - 数据库
i*s
1
how to turn off IDENTITY_INSERT when inserting explicit
value for identity column? thanks!
avatar
s*c
2

~~~? on?
Only the table owner, the Database Owner, or the System
Administrator can explicitly insert a value into an IDENTITY
column. Before inserting the data, the user must set the
identity_insert option on for the table. A user can set
identity_insert on for only one table at a time in a
database.
This example specifies a "seed" value of 101 for the
IDENTITY column:
set identity_insert sales_daily on
insert into sales_daily (syb_identity, stor_id) values
(101, '13-J-9'

【在 i****s 的大作中提到】
: how to turn off IDENTITY_INSERT when inserting explicit
: value for identity column? thanks!

avatar
i*s
3
you are right, should be on instead.
thanks a lot, skeptic.

【在 s*****c 的大作中提到】
:
: ~~~? on?
: Only the table owner, the Database Owner, or the System
: Administrator can explicitly insert a value into an IDENTITY
: column. Before inserting the data, the user must set the
: identity_insert option on for the table. A user can set
: identity_insert on for only one table at a time in a
: database.
: This example specifies a "seed" value of 101 for the
: IDENTITY column:

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