Skip to Content

Solved: How do I change the value on the ID column in MS SQL 2012?

Question

If the Identity column is set to full specification and to increment on its own, how do I change the ID’s value for one of the records in Microsoft SQL Server 2012?

If the Identity column is set to full specification and to increment on its own, how do I change the ID's value for one of the records in Microsoft SQL Server 2012?

Solution

Execute the following SQL query in the SQL Server Management Studio: SET IDENTITY_INSERT myTable ON;

Execute the following SQL query in the SQL Server Management Studio: SET IDENTITY_INSERT myTable ON;

Reference: Docs > SQL > Reference > Transact-SQL (T-SQL) Reference > Statements > SET > IDENTITY_INSERT > SET IDENTITY_INSERT (Transact-SQL)

Tags

Tags

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. We need money to operate the site, and almost all of it comes from online advertising. Please support us by disabling these ads blocker.

Please disable ad blocker