Smart rename does not respect scopes
Smart rename does not work properly in queries where there are common table expressions and, for instance, two of them use the same alias for the same (or even different) table. When I want to change the name of an alias, then the rename should not pick up the same alias from other scopes. The current rename is potentially dangerous because there could be a clash when, for instance, one piece of a query is dependent on another (think: cross apply or correlated query). I would classify the current behaviour as a bug but I can imagine that one could argue "this is a feature".
Hi Darek,
It sounds like you might have hit a bug as the rename in SQL Prompt should be respecting the scope of the alias. I’m going to close this UserVoice idea since it sounds more like a bug than a feature. I see you already have a ticket logged with our support team – if you forward them recreation steps/scripts we can investigate this further.
Thanks,
Aaron.