Search

Problem With 'sp_refreshsqlmodule' On Publish When Stored Proc Names Contain Spaces by Gerard.Escalante

Closed
as Fixed Help for as Fixed

3
0
Sign in
to vote
Type: Bug
ID: 774897
Opened: 12/20/2012 2:35:36 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
Within SSDT, on publish, the code generated to refresh stored procedures does not correctly handle spaces in stored procedure names.

The PRINT message above the call to 'sp_refreshsqlmodule' is properly escaped, while the actual call to sp_refreshsqlmodule is not.
Details (expand)

Product Language

English

Version

SQL Server 2012 - Standard Edition

Category

Developer Tools (SSDT, BIDS, etc.)

Operating System

Other

Operating System Language

English

Steps to Reproduce

1. Create and publish a database with a stored procedure with a space somewhere in its name.
2. Make a change to the database which would cause SSDT to call sp_refreshsqlmodule for the stored procedure created in step 1 on publish.

Actual Results

-----------------------------------
Generated Publish SQL
-----------------------------------
PRINT N'Refreshing [TestScripts].[Test Equal Balances-A]...';


GO
EXECUTE sp_refreshsqlmodule N'TestScripts.Test Equal Balances-A';


GO

-----------------------------------
Execution Result of SQL
-----------------------------------
Refreshing [TestScripts].[Test Equal Balances-A]...
(243,1): SQL72014: .Net SqlClient Data Provider: Msg 15165, Level 16, State 1, Procedure sp_refreshsqlmodule_internal, Line 55 Could not find object 'TestScripts.Test Equal Balances-A' or you do not have permission.
(189,0): SQL72045: Script execution error. The executed script:
EXECUTE sp_refreshsqlmodule N'TestScripts.Test Equal Balances-A';

Expected Results

-----------------------------------
Expected Publish SQL
-----------------------------------
PRINT N'Refreshing [TestScripts].[Test Equal Balances-A]...';


GO
EXECUTE sp_refreshsqlmodule N'[TestScripts].Test Equal Balances-A';


GO

-----------------------------------
Expected Result of SQL
-----------------------------------
Refreshing [TestScripts].[Test Equal Balances-A]...


There should be no error.

Platform

 

Virtualization

 
File Attachments
0 attachments
Sign in to post a comment.
Sign in to post a workaround.