Sqlserver -- 怎样改动设置主键的id能够手动更新?

#1 打开表的设计界面

#2 将主键id的is Identity的属性改成No

这样就能够通过Update语句来更新表的主键id了。

怎样又一次设置主键id的自增长開始值呢?

#1 命令:DBCC CHECKIDENT (tableName, reseed, 1000000)

#2 DBCC:

DBCC help('?') 查看全部的dbcc命令

DBCC HELP('checkdb') 查看单个命令的具体

无需手动改动的方式:

SET IDENTITY_INSERT master_location ON

Insert sql

SET IDENTITY_INSERT master_location OFF

Cannot update identity column 'XXX'的更多相关文章

  1. mysql主键设置成auto_increment时,进行并发性能測试出现主键反复Duplicate entry 'xxx' for key 'PRIMARY'

    mysql主键设置成auto_increment时,进行并发性能測试出现主键反复Duplicate entry 'xxx' for key 'PRIMARY' 解决方法: 在my.cnf的[mysql ...

  2. Unable to instantiate Action, xxxAction, defined for 'xxx' in namespace '/'xxxAction解决方式

    出现这个问题的解决办法主要有两个 1.假设项目没有使用Spring,则struts.xml配置文件里,这个action的class属性的路径没有写完整,应该是包名.类名 2.假设项目使用了Spring ...

  3. Part 4 Identity Column in SQL Server

    Identity Column in SQL Server If a column is marked as an identity column, then the values for this ...

  4. 报错:Cannot insert explicit value for identity column in table 't' when identity_insert is set to OFF

    通常情况下,不能向 SQL Server 自增字段插入值,如果非要这么干的话,SQL Server 就会好不客气地给你个错误警告: Server: Msg 544, Level 16, State 1 ...

  5. An explicit value for the identity column in table can only be specified when a column list is used and IDENTITY_INSERT is ON

    If you run into the following error message: An explicit value for the identity column in table '< ...

  6. ORACLE 12C Identity Column(身份列) 实现自增长字段

    Oracle 12c提供的Identity Column特性简化了自增字段的定义. 声明自增字段通常有3种常见的用法,以下三种方式都支持INSERT语句中省略自增字段的插入,但有些许差别. 1. GE ...

  7. [Django](1093, &quot;You can&#39;t specify target table &#39;fee_details_invoices&#39; for update in FROM clause&quot;) 错误

    dele_id = Fee_details_invoices.objects.filter(fee_detail_id__in=fee_id_list, return_type='2').values ...

  8. 错误代码: 1054 Unknown column &#39;t.createUsrId&#39; in &#39;group statement&#39;

    1.错误描写叙述 1 queries executed, 0 success, 1 errors, 0 warnings 查询:select count(t.id),t.`createUserId` ...

  9. 解决Incorrect integer value: &#39;&#39; for column &#39;id&#39; at row 1的方法

    在使用Navicat for MySQL还原数据库备份时.出现Incorrect integer value: '' for column 'id' at row 1的错误; 网上查资料发现5以上的版 ...

随机推荐

  1. LN : Eden Bitset_3

    Appreciation to our TA, 王毅峰, who designed this task. 问题描述 Give you N numbers a[1]...a[n] and M numbe ...

  2. CF864D Make a Permutation!

    思路: 贪心,构造,模拟. 实现: #include <bits/stdc++.h> using namespace std; ], a[], vis[], n; int main() { ...

  3. 继承static的注意点

    继承static的注意点 singleton模式会使用 <?php class Auth { protected static $_instance = null; /** * 单用例入口 * ...

  4. 02使用常规步骤编译NanoPiM1Plus的Android4.4.2

    02使用常规步骤编译NanoPiM1Plus的Android4.4.2 大文实验室/大文哥 壹捌陆捌零陆捌捌陆捌贰 21504965 AT qq.com 完成时间:2017/12/5 17:51 版本 ...

  5. Android Retrofit+Rxjava2问题小记

    网络请求有个问题就是取消操作. 在Rxjava1中,调用subscribe之后会返回Subscription,然后利用CompositeSubscription进行统一管理. 在Rxjava2中,调用 ...

  6. Python3.4的Pillow库实现验证码图片

    转自 http://blog.csdn.net/bin381/article/details/41969493 from PIL import Image,ImageDraw, ImageFont, ...

  7. table的数据行tr上下移动

    昨天帮别人解决一个前端页面表格里的数据行上下移动的前端效果,直奔google找了几个demo,发现demo是实现了效果,但是代码很多,最后还是决定自己用jquery写个吧, 首先将前端效果分析出编程逻 ...

  8. (转) 淘淘商城系列——Redis集群的搭建

    http://blog.csdn.net/yerenyuan_pku/article/details/72860432 本文我将带领大家如何搭建Redis集群.首先说一下,为何要搭建Redis集群.R ...

  9. HDU_1421_搬寝室_dp

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1421 搬寝室 Time Limit: 2000/1000 MS (Java/Others)    Me ...

  10. java protostuff 序列化反序列化工具

    protostuff是由谷歌开发的一个非常优秀的序列化反序列化工具 maven导入包: <dependency> <groupId>io.protostuff</grou ...