如何在sqlserver中更新标识列值 [英] How to update identity column value in sqlserver

查看:118
本文介绍了如何在sqlserver中更新标识列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在制作中有一个带有标识列的表,并且手动插入了一些重复的标识。现在我想用标识列的下一个增量值更新重复值。

I have one table in production with identity column and there are some duplicate id's are inserted manually. Now i want to update the duplicate values with next increment values of identity column.

请帮助我。

问候,




Vaishu

推荐答案

你无法使用IDENTITY属性更新列,您必须插入具有新值的记录并删除具有旧值的记录。
You can not update a column with IDENTITY property, you have to insert the record with new value and delete the one with the old value.


这篇关于如何在sqlserver中更新标识列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆