Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Retrive data using SQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-17 : 08:26:33
Stephanie writes "Example: I have 2 different database (HR database, Login database). I need to compare the data in the HR database with the Login database. how am i going to select the data in sql."

Nazim
A custom title

1408 Posts

Posted - 2002-07-17 : 08:33:48
you can use four part naming convention.

select col1 from Servername.login.dbo.tablenametocompare t1
inner join Servername.hr.dbo.tablenametocompare t2
on t1.comparekey=t2.comparekey


HTH




-------------------------
What lies behind you and what lies ahead of you are small matters compared to what lies within you.-Ralph Waldo Emerson


Edited by - nazim on 07/17/2002 08:36:16
Go to Top of Page
   

- Advertisement -