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 the difference between a function and a trigger?

672


Explain the flow of creating a cube? : sql server analysis services, ssas

712


Explain what is the use of custom fields in report?

590


What is the bookmark lookup and rid lookup?

656


what is the difference in login security modes between v6.5 and 7.0? : Sql server database administration

736






What is the difference between set and select?

659


Why should we go for stored procedures? Why not direct queries?

655


What is analysis service repository?

679


Can we insert data into view sql server?

616


What are the different types of replication you can set up in sql server?

621


Can you change the data type of a column in a table after the table has been created? If so, which command would you use?

718


What is the sql profiler?

612


What is the contrast amongst drop and truncate?

636


Can group functions be used in the order by clause in ms sql server?

680


Explain the categories of stored procedure?

610