How can we help you today? How can we help you today?

Bug? Ctrl+B, Ctrl+Q assigns same alias to both parts of the JOIN

Version 7.3.0.775
UPDATE uvu
               SET IncludeInVersionResult = 0
            FROM #UniqueVersions uvu
             WHERE VersionNumber <> 1
                   AND PromotionID IN ( SELECT PromotionID
                                          FROM #UniqueVersions UV
                                         WHERE UV.SlotSetID = SlotSetID
                                               AND UV.SlotNum = SlotNum
                                               AND UV.PromotionID = PromotionID
                                               AND UV.ContentID = ContentID
                                               AND UV.VersionNumber = 1
                                               AND CAST(UV.AssignedGeographies AS nvarchar(max)) <> CAST(AssignedGeographies AS nvarchar(max))
                                      );

Ends up as:
UPDATE uvu
               SET uvu.IncludeInVersionResult = 0
            FROM #UniqueVersions uvu
             WHERE VersionNumber <> 1
                   AND PromotionID IN ( SELECT UV.PromotionID
                                          FROM #UniqueVersions UV
                                         WHERE UV.SlotSetID = UV.SlotSetID
                                               AND UV.SlotNum = UV.SlotNum
                                               AND UV.PromotionID = UV.PromotionID
                                               AND UV.ContentID = UV.ContentID
                                               AND UV.VersionNumber = 1
                                               AND CAST(UV.AssignedGeographies AS nvarchar(max)) <> CAST(UV.AssignedGeographies AS nvarchar(max))
                                      );

The right-hand side qualifiers s/b uvu, not UV.
PDinCA
0

Comments

2 comments

  • James R
    Hey @PDinCA, thanks for the post :smile:

    I've managed to reproduce this locally and logged it in our system, hopefully we'll have a fix soon.

    Cheers,
    James
    James R
    0
  • TomW
    Hi @PDinCA

    We're really sorry this forum post has slipped under the radar. We've just tested it on the latest version of SQL Prompt and it seems that development work on our aliasing system has solved this issue. Please don't hesitate to let us know if you're still having problems.

    Thanks,
    Tom
    TomW
    0

Add comment

Please sign in to leave a comment.