Bug Fix: SSMS 2012 SP1 CU7 generates deprecated Execute code

Please correct a problem with code that was likely written many years ago.

I tried to find source of the Deprecated Feature error in my code unsuccessfully, when I finally realized that the source of the problem is in code that SSMS generated.

SQL Azure will not run this code generated in SSMS when you right-click a stored procedure, and select "Execute Stored Procedure". It will generate the following:

USE [MyDB]
GO

DECLARE @return_value int

EXEC @return_value = [dbo].[usp__MyRoutine]

SELECT 'Return Value' = @return_value

GO

When you execute this, SQL Azure returns:

Error #: 40512 Deprecated feature String literals as column aliases is not supported in this version of SQL Server.

Please have SSMS always, regardless of Azure or Local database, modify the output line containing the SELECT to read as follows:

SELECT @return_value AS [Return Value]

Microsoft has solved bigger challenges than this, please ensure that it is corrected in the next bug fix / new version.



  • Edited by marilynm Friday, January 10, 2014 9:46 PM
January 11th, 2014 12:40am

I also reposted this to http://feedback.windowsazure.com/forums/217321-sql-database
Free Windows Admin Tool Kit Click here and download it now
January 11th, 2014 1:13am

Hello,

The error occurs in the usage in this string: SELECT 'Return Value' = @return_value.
This syntax is no longer supported, please try to use 'AS name' instead. For example,

SELECT @return_value AS [Return Value]

Regards,
Fanny Liu

If you have any feedback on our support, please click here.

January 12th, 2014 9:44pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics