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
Differentiate between a primary key and a unique key.
You have several tables, and they are joined together for querying. The tables contain both clustered indexes and non clustered indexes to optimize performance, how should you distribute the tables and their indexes onto different file groups?
What are the advantages of stored procedure in sql server?
What is the template in sql?
How can i Relate Tables in SSIS
Where sql server usernames and passwords are stored in a sql server?
Explain sub-query?
Where is trigger in sql server?
What are unicode character string data types in ms sql server?
What are the different index configurations a table can have?
You want your report to display a hyperlink that will take users to your intranet. How do you configure such a hyperlink?
What is the language structure to add a record to a table?
What are the new features are introduced in sql server 2012 reporting services?
How to optimize stored procedures in sql server?
Why variables called the most powerful component of ssis?