SYNTAX:
DBCC CHECKIDENT ('TEST', RESEED, 0)
Lets Explorer It…….
STEP 1:- CREATE TABLE
CREATE TABLE TEST
(
SRNO INT IDENTITY (1, 1),
NAME VARCHAR (100)
)
STEP 2:- INSERT THE VALUES IN THE TABLE
INSERT INTO TEST (NAME) VALUES ('RAM')
INSERT INTO TEST (NAME) VALUES ('RAM')
STEP 3:- SELECT THE RECORD FROM TABLE
SELECT * FROM TEST
RESULTS
SRNO NAME
----------- -------
1 RAM
2 RAM
(2 ROW(S) AFFECTED)
STEP 4:- RESET IDENTITY
DBCC CHECKIDENT ('TEST', RESEED, 0)
MESSAGES
CHECKING
IDENTITY INFORMATION: CURRENT IDENTITY VALUE '2'.
DBCC EXECUTION COMPLETED. IF DBCC PRINTED ERROR MESSAGES, CONTACT
YOUR SYSTEM ADMINISTRATOR.
STEP 5:- INSERT THE VALUES IN THE TABLE
INSERT INTO TEST (NAME) VALUES ('RAM')
INSERT INTO TEST (NAME) VALUES ('RAM')
STEP 6:- SELECT THE RECORD FROM TABLE
SELECT * FROM TEST
RESULTS
SRNO NAME
----------- -------
1 RAM
2 RAM
1 RAM
2 RAM
No comments:
Post a Comment