Showing posts with label thanx. Show all posts
Showing posts with label thanx. Show all posts

Friday, March 23, 2012

Joining two tables

Hi all,
Can anyone tell how to join two tables where first table is in db1
and second table in db2..
Looking forward for ur response..
Thanx in advance...
SELECT *
FROM [DB1].[dbo].[Table1] A
JOIN [DB2].[dbo].[Table2] B
ON A.[Key] = B.[Key]
Nik Marshall-Blank MCSD/MCDBA
"Prince" <princevictor.moses@.gmail.com> wrote in message
news:1128077633.696943.139960@.z14g2000cwz.googlegr oups.com...
> Hi all,
> Can anyone tell how to join two tables where first table is in db1
> and second table in db2..
> Looking forward for ur response..
> Thanx in advance...
>
|||Hi marshall...
Thanx for ur response...

Joining two tables

Hi all,
Can anyone tell how to join two tables where first table is in db1
and second table in db2..
Looking forward for ur response..
Thanx in advance...SELECT *
FROM [DB1].[dbo].[Table1] A
JOIN [DB2].[dbo].[Table2] B
ON A.[Key] = B.[Key]
Nik Marshall-Blank MCSD/MCDBA
"Prince" <princevictor.moses@.gmail.com> wrote in message
news:1128077633.696943.139960@.z14g2000cwz.googlegroups.com...
> Hi all,
> Can anyone tell how to join two tables where first table is in db1
> and second table in db2..
> Looking forward for ur response..
> Thanx in advance...
>|||Hi marshall...
Thanx for ur response...

Wednesday, March 21, 2012

Joining two tables

Hi all,
Can anyone tell how to join two tables where first table is in db1
and second table in db2..
Looking forward for ur response..
Thanx in advance...SELECT *
FROM [DB1].[dbo].[Table1] A
JOIN [DB2].[dbo].[Table2] B
ON A.[Key] = B.[Key]
--
Nik Marshall-Blank MCSD/MCDBA
"Prince" <princevictor.moses@.gmail.com> wrote in message
news:1128077633.696943.139960@.z14g2000cwz.googlegroups.com...
> Hi all,
> Can anyone tell how to join two tables where first table is in db1
> and second table in db2..
> Looking forward for ur response..
> Thanx in advance...
>|||Hi marshall...
Thanx for ur response...

Friday, March 9, 2012

Join two tables of different database

Hi , let table a belongs to db1 and table b belongs to db2 . how can i join these two tables can any one give me examples... thanx in advance

Quote:

Originally Posted by krishnasarma

Hi , let table a belongs to db1 and table b belongs to db2 . how can i join these two tables can any one give me examples... thanx in advance


try:

select <field list>
from db1.dbo.tableA tbla
left/inner/right/full join db2.dbo.tablB tblb on tbla.linkfiend = tblb.linkfield

dependeing on your requirement, you can choose whether it's a left, inner , full or right outer join. you might also need analyze what field to use to link the two tables