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!!!

    This site depends on revenue from ad impressions to survive. If you find this site valuable, please consider disabling your ad blocker.