SSDT Rename Table refactor breaks sprocs that used the simple table name as an alias - by Bryn_work

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 794441 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 7/18/2013 2:40:35 PM
Access Restriction Public


Given a database project with a schema called Schema1 and a table called Table1, with a single column called Id, and a single stored procedure defined thus:

CREATE PROCEDURE [dbo].[Procedure1]
	@param1 int = 0,
	@param2 int
	FROM Schema1.Table1 Table1
	JOIN Schema1.Table1 other ON other.Id = Table1.Id

If I do a Rename refactoring on Schema1.Table1, and change its name to ZTable1, SSDT incorrectly renames uses of the ALIAS Table1 to ZTable1 in stored procedures as well, which breaks the query:

CREATE PROCEDURE [dbo].[Procedure1]
	@param1 int = 0,
	@param2 int
	FROM Schema1.ZTable1 Table1
	JOIN Schema1.ZTable1 other ON other.Id = ZTable1.Id -- <--- this should not have been renamed

Sign in to post a comment.
Posted by Karel Frajták on 6/27/2016 at 4:42 AM
"Won't fix" Seriously?
Posted by Karel Frajták on 6/27/2016 at 4:40 AM
In my case table reference was not renamed in SELECT statement: select Clients.* from Clients --> select Clients.* from [RenamedClients]
Posted by Microsoft on 8/5/2013 at 4:07 PM

Thank you for bringing this issue to our attention. We will look into getting this fixed in a future release of SQL Server Data Tools.