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
How do I create a partition table in sql server?
Why use cursor in sql server?
How to execute a stored procedure in ms sql server?
What is the difference between primary key and unique constraints?
Which is faster statement or preparedstatement?
What is the Main Difference between ACCESS and SQL SERVER?
What are click through reports?
What are blobs, tables, and Queues? Is SQL is the standard way to query blobs, tables, and queues?
What is single-user mode and what are the steps you should follow to start sql server in single-user mode?
I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that
What are various limitations of the views?
You are creating an application where users are asked their gender in the gender combo box you have three options: ‘male’ , ‘female’ and ‘i choose not to disclose’ these options are stored in the table as 1, 0 or null which datatype should you use?
How to Sync Two SQL Azure Databases?
What is Command line parameters in PLSQL.?
Can binary strings be converted into numeric or float data types?