Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
my issue is

i have get data from different database on same server
into my datbase ( only selected data not import or export all)
(e.g)
My db name Roaster and table name overtime

other db name HR and table employeesalary

so i have to pick employee salary from HR datbase by employeeno(its also
exist in my Roaster database table )

i want to pass employeeno to Hr datbase from Roaster to extract record
how can i do this ?

thanks
Posted
Comments
Jim Jos 29-May-12 3:17am    
Sir! study about inner joins!!

1 solution

Hope this helps you
XML
<pre lang="sql">

SELECT a.salary  FROM HR .dbo.employeesalary a inner join Roaster .dbo.overtime b  ON a.employeeno=b.employeeno</pre>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900