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
 Old Forums
 CLOSED - SQL Server 2005/Yukon
 SQL SERVER 2005

Author  Topic 

praveendaya
Starting Member

13 Posts

Posted - 2006-06-14 : 15:26:09
Helo everybody,

I am praveen, a master student working part time in a company. i m new to this forum and hope u all give me a warm welcome......

At work i came across a tricky thing which i was not able to resolve, may be because i m new to sql server 2005.

the thing is this.... I was trying to do a merge join(inner join) transformation for two tables on one join key condition. I got like 2 rows in my destination. But if i do the same join condition in the sql server management studio i m gettin more than 2 rows in the resultset and i m really struck with this.

Norwich
Posting Yak Master

158 Posts

Posted - 2006-06-15 : 08:57:10
Hi

Post your query and we'll tell you what's wrong with it

Regards
N

The revolution won't be televised!
Go to Top of Page

praveendaya
Starting Member

13 Posts

Posted - 2006-06-15 : 11:15:18
hi,

this is my query...

select distinct s.profession_id, cc.item_description
from staff s
inner join common_code cc
on s.profession_id = cc.item_id

Go to Top of Page

mr_mist
Grunnio

1870 Posts

Posted - 2006-06-16 : 05:12:59
If you're running the exact same query and geting different results back then my guess is that you're running it against two different databases.

-------
Moo. :)
Go to Top of Page

praveendaya
Starting Member

13 Posts

Posted - 2006-06-16 : 10:03:39
no i m pretty much sure that i use the same databases for both the tables....
Go to Top of Page

Norwich
Posting Yak Master

158 Posts

Posted - 2006-06-19 : 09:26:48
Please post the other query that you are using to extract the data to your destination table.
The query that return the 2 rows

Regards
N

The revolution won't be televised!
Go to Top of Page

michaelxvo
Starting Member

47 Posts

Posted - 2006-06-20 : 11:39:44
If you try this
select distinct s.profession_id from staff s inner join common_code cc on s.profession_id = cc.item_id

take out the cc.item_description in your query,
hope the duplicate will not appear
Go to Top of Page

praveendaya
Starting Member

13 Posts

Posted - 2006-06-21 : 10:14:20
but i need cc.item_description on the output grid.....
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-21 : 10:19:05
can you post the tables structure (only the relevant columns), same sample data and the result that you want ?


KH

Go to Top of Page

michaelxvo
Starting Member

47 Posts

Posted - 2006-06-21 : 13:41:44
quote:
Originally posted by praveendaya

but i need cc.item_description on the output grid.....


IF SO USE SUBQUERY

select item_id,item_description
from common_code
where item_id = (select distinct profession_id from staff where profession_id = item_id)
Go to Top of Page

praveendaya
Starting Member

13 Posts

Posted - 2006-07-08 : 22:22:01
i think you all misunderstood my issue......

its like this see.... the same inner join which i run in MANAGEMENT STUDIO and BUSINESS INTELLIGENCE STUDIO gives me different results.... both shud get me the same rows right but i get few rows less in businees intelligence studio..... i donno wats the reason....

In business intelligence studio i run this inner join using MERGE JOIN transformation..... i guess some one tell me how merge join transformation works..... coz i m pretty much sure there is some problem with the merge join transformation....

thanks n regards
Praveen kumar Dayanithi
Go to Top of Page

sunitagoswami
Starting Member

10 Posts

Posted - 2006-07-10 : 10:28:53
What is MANAGEMENT STUDIO and BUSINESS INTELLIGENCE STUDIO ??

Sunita
Go to Top of Page

praveendaya
Starting Member

13 Posts

Posted - 2006-07-10 : 23:00:26
Oh..... those are like Enterprise manager and query analyser in SQL server 2000. But in a much advanced way of presenting things.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-07-11 : 00:01:25
i might just oversimplifying it...

add: " use [databasename] GO " before your query just to be sure



--------------------
keeping it simple...
Go to Top of Page

praveendaya
Starting Member

13 Posts

Posted - 2006-07-12 : 12:20:52
i dont think there is any problem with the query(Management studio)...i guess it works fine and i m pretty much sure that the query which i m using is also the right one.

My only concern is the inner join transformation in SSIS.
See i ll explain my problem clearly now.....

Actually i m just checkin if the inner join performed in business intelligence studio usin the inner join transformation and the inner join performed in the management studio using queries are same. Logically both the resultset should match isn't but in my case it is not so. It is very important for me to figure out where the problem is because i m goin to use lotsa inner join transformations in my current project.

I ll appreciate if someone can help me to figure out this problem. May be you can also tell me the detailed steps in adding the inner join transformation and also how it works.


thanks in advance,
Praveen kumar Daynithi
Go to Top of Page
   

- Advertisement -