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 / challa yerriswamy

set identity_insert <table_name> on
insert into text1(id,id_name) values(2,'insertedat2')

Is This Answer Correct ?    13 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you type more than one query in the query editor screen at the same time?

576


How optimize sql query with multiple joins in sql server?

417


Why can there be only one clustered index and not more than one?

546


Explain “row_number()” in sql server with an example?

524


What are the different ways you can create databases in sql server?

573






How do I create an extended event in sql server?

491


What is the full form of ddl?

509


What happens if null values are involved in bitwise operations?

607


What is a View ? Can we insert, Update and delete a view?

631


Explain steps of normalization?

527


You notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it?

644


What is a Join and explain its types?

586


How to provide values to user defined function parameters?

557


Explain what is use of dbcc commands?

515


What is the difference between truncate and delete commands?

567