| 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
|
| HiPost your query and we'll tell you what's wrong with itRegardsNThe revolution won't be televised! |
 |
|
|
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 |
 |
|
|
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. :) |
 |
|
|
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.... |
 |
|
|
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 rowsRegardsNThe revolution won't be televised! |
 |
|
|
michaelxvo
Starting Member
47 Posts |
Posted - 2006-06-20 : 11:39:44
|
| If you try thisselect distinct s.profession_id from staff s inner join common_code cc on s.profession_id = cc.item_idtake out the cc.item_description in your query, hope the duplicate will not appear |
 |
|
|
praveendaya
Starting Member
13 Posts |
Posted - 2006-06-21 : 10:14:20
|
| but i need cc.item_description on the output grid..... |
 |
|
|
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 |
 |
|
|
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 SUBQUERYselect item_id,item_descriptionfrom common_codewhere item_id = (select distinct profession_id from staff where profession_id = item_id) |
 |
|
|
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 regardsPraveen kumar Dayanithi |
 |
|
|
sunitagoswami
Starting Member
10 Posts |
Posted - 2006-07-10 : 10:28:53
|
| What is MANAGEMENT STUDIO and BUSINESS INTELLIGENCE STUDIO ??Sunita |
 |
|
|
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. |
 |
|
|
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... |
 |
|
|
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 |
 |
|
|
|