Columns from new table joined not showing up in result table

  • We've got several tables in a SQL Real Estate Property DB that are all tied together by "AddressKey". We needed to modify an existing stored proc in order to add 2 data columns from a table that had not yet been joined. After selecting the two required columns from the new table and doing a LEFT JOIN on matching AddressKey row, the new columns are not added to the result set (multiple rows of properties with matching eg RegionID).

    This new table is successfully joined in a different stored proc with a single row result set and yields valid results and data. But for some reason doesn't join for this other stored proc.

    Can anybody enumerate the possible reasons for this? Unfortunately, I'm not at liberty to post the proc.

    Best Regards,

    Jeff

  • Without seeing some kind of code it is nearly impossible to figure out what is wrong other than asking, Are you sure actually altered the SP? If you did alter the SP, did you add the expected columns to the column list?

  • As Jack said it is difficult to tell you the answer if we have no code or DDL to base our answer on. A few possible reasons come to my mind.

    1. You did not add the new columns to the select list

    2. There are no rows that match your join criteria, thus no extra rows are returned.

    Also, what does this mean?

    the new columns are not added to the result set

    Does this mean the column name appears in the results, but does not have data? Or does this mean the column names do not appear in the result set?

  • Hi, everybody! Thank you for your replies. I do appreciate it. Well, as I somewhat suspected, the problem turned out to be that the updated SP did not get synchronized to the mirror DB that I was using. The administrator realized this on his drive home from work and fixed it when he got home. I guess I should have asked the stupid question... 🙂

    Thanks again!

    J

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply