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


Please Help Members By Posting Answers For Below Questions

How do I find the port number for sql server?

703


Can we use trigger new in before insert?

692


What are the drawbacks of reporting in ssrs?

124


What are SSL and TSL protocols?

758


What are the properties of sub-query?

795


What objects does the fn_my_permissions function reports on? : sql server security

768


What are the differences between left join and inner join in sql server?

783


Distinguish between commit and rollback?

712


What are the limitations in ssrs on sql server express edition?

158


How do clustered indexes store data?

816


how can you check the level of fragmentation on a table? : Sql server administration

722


What is deploy, process and build? : sql server analysis services, ssas

769


What is the difference between a primary key and a unique key? Are they the same?

785


what are the reporting service components in SSRS?

139


How to send a ssrs report from ssis?

151