how to rest identity columns in sql server

Answer Posted / muthu kumar

create table t(id int identity(seed,increment))

where seed is starting number and increment is number to be
incremented.

create table t(id int identity(1,1),name varchar(50))

so the id will be start with 1 and will be incremented 1 by
1 each time when record is get insered

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a database table?

538


What is data mart? : sql server analysis services, ssas

609


What is database architecture? : SQL Server Architecture

561


What are indexes in sql?

586


What is the stored procedure?

572






How to verify a login name with sqlcmd tool?

603


Which sql server table is used to hold the stored procedure scripts?

624


How can we improve performance by using SQL Server profiler?

586


What is create statement?

541


What is the difference between functions and scalar functions?

579


What do you understand by replication in sql server? Mention the different types of replication in sql server.

519


How does clustered and non clustered index work?

527


How to get the query of a table in sql server?

508


How you can change the database name in SQL SERVER?

681


What are various ways to enhance the ssrs report?

544