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

What is a partitioned view?

585


Does full backup break log chain?

560


Explain what are the authentication modes in sql server?

512


What are the different types of sub-queries?

608


How to insert stored procedure result into temporary table?

599






What is raid? : SQL Server Architecture

608


Does any body please help me what question's have asked for SSRS in the interview?

1679


Explain about local stored procedure?

519


How to convert numeric expression data types using the cast() function?

563


Does hive support indexing?

530


What are click through reports?

101


Stored Procedure returns data from multiple tables. How to access it in your ASP.Net code?

563


Are semicolons required at the end of sql statements in sql server 2005?

578


How to drop an existing schema in ms sql server?

614


What is query optimizer in sql server?

559