here id col have primary key and identity
id name
1 a
2 b
3 c
4 d
delete 2nd row then o/p will be
id name
1 a
3 c
4 d
next inssert 2nd row and i want o/p will be
id name
1 a
2 e
3 c
4 d
Answer Posted / sunilkumar
set identity_insert on
insert into test1(Id ,id_name) values (2 ,'insertedat2')
Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
difference between Clustered index and non clustered index ?
Can you please explain the difference between primary keys and foreign keys?
Explain for xml explicit mode?
How do you identify a foreign key?
role of sql sever 2005 in database rather than any other database
What happens if you insert a duplicate key for the primary key column in ms sql server?
How can we determine what objects a user-defined function depends upon?
What are the purposes and advantages stored procedure?
Sql server reporting services vs. Crystal reports.
what kind of lan types do you know? : Sql server database administration
What does null mean?
What is the difference between ‘having’ clause and a ‘where’ clause?
What are actions, how many types of actions are there, explain with example? : sql server analysis services, ssas
What is the importance of a recovery model?
How to get a list all databases on the sql server?