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...


write down the sql query?

Table Name : emp1
empid empname
1 bala
2 guna

Table Name : emp2
empid empname
1 <Null>
2 <Null>

Solution : emp1 names are updated in emp2, write a query?

Answers were Sorted based on User's Feedback



write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Nam..

Answer / dhana

update e2 set e2.empname = e1.empname
from emp2 e2,emp1 e1
where e1.empid = e2.empid

Is This Answer Correct ?    8 Yes 1 No

write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Nam..

Answer / vidya

update emp2 set empname =e.empname from emp1 e where
e.empid =emp2.empid

Is This Answer Correct ?    1 Yes 1 No

write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Nam..

Answer / a

Update emp2 set empname = (Select empName from emp1 where
emp2.empid =emp1.empid)

Is This Answer Correct ?    2 Yes 2 No

write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Nam..

Answer / vicky

update emp2 e2 set e2.empname = (select e1.empname from
emp1 e1 where e2.empid=e1.empid)

Is This Answer Correct ?    0 Yes 0 No

write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Nam..

Answer / saravanan

update w set w.ename=q.ename from empn1 w,
(select e.ename,e.empid from empn e,empn1 a where
a.empid=e.empid) q where w.empid=q.empid

Is This Answer Correct ?    0 Yes 1 No

write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Nam..

Answer / rajesh.a

Update e2
set e2.empname=e1.empname
from
emp2 e2 inner join emp1 e1 on e1.empid=e2.empid

Is This Answer Correct ?    0 Yes 1 No

write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Nam..

Answer / pradip jain

update e2
set e2.name= e1.name
from emp2 e2
join emp1 e1 on e1.id=e2.id

Is This Answer Correct ?    0 Yes 1 No

write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Nam..

Answer / rafi

Insert in to emp2 values as select * from emp1;

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More SQL Server Interview Questions

What is SQL Profiler and the use of it?

2 Answers   247Customer,


What is a hint?

0 Answers  


What is intellisense?

0 Answers  


Tell me extended events in sql server 2008?

0 Answers  


in emptable i want to retrive the name of employee whose name in 'J'char.exp: arjun,jagadesh,niranjan,anju,aaaj etc.

8 Answers  


What is the difference between Userdefined function and stored procedure? Explain and give the example also

5 Answers  


In the below query i have performed the commit transaction statement but still the values after the save are not saved. Can you please let me know why are the statements after save are rolled back even after commiting the data. help me with the understanding declare @trans2 varchar(10)='transaction2' begin transaction @trans2 insert into emp values(100,'xy',600); save transaction @trans2 insert into emp values(200,'pq',700); insert into emp values(300,'pq',800); commit transaction @trans2 rollback tran @trans2

1 Answers   AllState,


What is used to replicate sessions between instances in coldfusion clusters?

0 Answers   HCL,


default databases available in sql server and there uses ?

4 Answers   TCS,


What does the INSTEAD OF trigger do?

3 Answers  


When we are using this query to shrink the log file,what exactly it will execute internally? Do we lose any data when we run this script? which data it will truncate in the log file and where it is saved. Please let me know... USE DatabaseName GO DBCC SHRINKFILE(<TransactionLogName>, 1) BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY DBCC SHRINKFILE(<TransactionLogName>, 1) GO

1 Answers   Cognizant,


What is BCP? When does it used in sql server 2012?

0 Answers   TryTechnicals Pvt Ltd,


Categories