﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / Join / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 18 May 2013 05:53:12 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Join</title><link>http://www.sqlservercentral.com/Forums/Topic1375360-391-1.aspx</link><description>Using the information given you can do something like this[code="sql"]SELECT *FROM OneDatabase.dbo.EmployeeLocation elJOIN SomeDatabase.dbo.Location l ON el.locationcode = l.locationcodeJOIN AnotherDatabase.dbo.Employee e ON el.employeeID = e.employeeID                              AND l.locationID = e.locationID[/code]You need to change the names of the databases and include the fields that you need insteadof the asterisk.I'm assuming that your databases are on the same server.</description><pubDate>Mon, 22 Oct 2012 09:06:27 GMT</pubDate><dc:creator>Luis Cazares</dc:creator></item><item><title>RE: Join</title><link>http://www.sqlservercentral.com/Forums/Topic1375360-391-1.aspx</link><description>You have to include the database name if the database resides on the same server:[code="sql"]SELECT *FROM MyDatabase.MySchema.MyTable;[/code]That will get it done. You can then join on the appropriate column.</description><pubDate>Mon, 22 Oct 2012 07:07:35 GMT</pubDate><dc:creator>Grant Fritchey</dc:creator></item><item><title>RE: Join</title><link>http://www.sqlservercentral.com/Forums/Topic1375360-391-1.aspx</link><description>Plzz follow this: [url]http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url];-)</description><pubDate>Mon, 22 Oct 2012 06:07:34 GMT</pubDate><dc:creator>Eugene Elutin</dc:creator></item><item><title>Join</title><link>http://www.sqlservercentral.com/Forums/Topic1375360-391-1.aspx</link><description>Hi,I have two tables employee(employeeId,LocationID) and employeelocation(employeeId,Locationcode).Both these tables exists in doff database. LocationCode in EmployeeLocation table has char values like XA,Ca etc and in employee table it has ID rather than Code. So how can I put join on these two columns of these two tables. this Location ID and LocationCode is stored in a table Location(LocationID, LocationCode)..plzz give a solution</description><pubDate>Mon, 22 Oct 2012 06:00:49 GMT</pubDate><dc:creator>kapil_kk</dc:creator></item></channel></rss>