[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 602
  • Last Modified:

how to alter the starting number for an identity column

Hi guys how do i change the increment number on a primary column in sql

i was thinking something like this, but that does not work

ALTER TABLE Warnings ALTER COLUMN WarningId [int] IDENTITY (50, 1) NOT NULL

0
tim_carter
Asked:
tim_carter
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
Force the current identity value to 50
This example forces the current identity value in the jobs table to a value of 50.
USE pubs
GO
DBCC CHECKIDENT (jobs, RESEED, 50)
GO
0
 
Anthony PerkinsCommented:
Do you mean the Identity Seed or the Identity Increment?  If it is the first than go with Aneesh's solution, if the second you will have to rebuild the table.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now