Home Dashboard Directory Help
Search

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


Status: 

Closed
 as Won't Fix Help for as Won't Fix


1
0
Sign in
to vote
Type: Bug
ID: 794441
Opened: 7/18/2013 2:40:35 PM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

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
AS
    SELECT *
    FROM Schema1.Table1 Table1
    JOIN Schema1.Table1 other ON other.Id = Table1.Id
RETURN 0

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
AS
    SELECT *
    FROM Schema1.ZTable1 Table1
    JOIN Schema1.ZTable1 other ON other.Id = ZTable1.Id -- <--- this should not have been renamed
RETURN 0



Details
Sign in to post a comment.
Posted by Microsoft on 8/5/2013 at 4:07 PM
Hi,

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.
Sign in to post a workaround.