Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



here id col have primary key and identity id name 1 a 2 b 3 c 4 d delete 2nd row ..

Answer / 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

here id col have primary key and identity id name 1 a 2 b 3 c 4 d delete 2nd row ..

Answer / qwerty

set identity_insert <table_name> on
insert into <table_name>(id,name) values(2,'e')
set identity_insert <table_name> off

Is This Answer Correct ?    12 Yes 0 No

here id col have primary key and identity id name 1 a 2 b 3 c 4 d delete 2nd row ..

Answer / sunilkumar

set identity_insert on
insert into test1(Id ,id_name) values (2 ,'insertedat2')

Is This Answer Correct ?    7 Yes 3 No

here id col have primary key and identity id name 1 a 2 b 3 c 4 d delete 2nd row ..

Answer / boby

insert into <table_name>(id,name) values(2,'e')ORDER BY ID

Is This Answer Correct ?    1 Yes 0 No

here id col have primary key and identity id name 1 a 2 b 3 c 4 d delete 2nd row ..

Answer / pradeep aryan

set identity_insert on
insert into test1(Id ,id_name) values (2 ,'e')
set identity_insert off

Is This Answer Correct ?    0 Yes 3 No

here id col have primary key and identity id name 1 a 2 b 3 c 4 d delete 2nd row ..

Answer / s pattnaik

SET IDENTITY_INSERT dbo.test1 OFF
Then
insert into test1(Id ,id_name) values (2 ,'insertedat2')

Is This Answer Correct ?    6 Yes 12 No

here id col have primary key and identity id name 1 a 2 b 3 c 4 d delete 2nd row ..

Answer / karthikeyan

select * from table_name order by id;

Is This Answer Correct ?    1 Yes 14 No

Post New Answer

More SQL Server Interview Questions

What are security principals used in sql server 2005?

0 Answers  


How to convert numeric expression data types by assignment operations?

0 Answers  


What is live lock and deadlock? what is Lock escalation?

2 Answers   Microsoft,


What are subquery and its properties?

0 Answers  


Why use “in” clause in sql server?

0 Answers  


How to optimize stored procedure optimization?

0 Answers  


Explain Different types of Projects?

1 Answers  


What can be used instead of trigger?

0 Answers   ADITI,


What are the different types of collation sensitivity?

0 Answers  


how can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role? : Sql server administration

0 Answers  


How to generate random numbers with the rand() function in ms sql server?

0 Answers  


List out the difference between union and union all in sql server?

0 Answers  


Categories