What are the challenges you face when working across database platforms? Take the survey
Options

Error Laying Out SQL on 9.1.4.4532

NgainerNgainer Posts: 16 Bronze 3
The bug fix in the latest release worked but caused a new issue: 
  • SP-6865 : 'Align data types and constraints' schema (DDL) formatting option could cause an argument null exception.

Now the "Format SQL" command fails if the script declares a variable with sysname.

USE master;
GO

/*
==============================================================================================================================
 Author: Person creating the Stored Procedure
 Create date: 03/22/2018
 Description:   Description of what procedure does
==============================================================================================================================
 Changes: 
 mm/dd/yyyy - Full Name - Short description of changes
==============================================================================================================================
 Indexes: 
 DatabaseName.Schema.IndexName
==============================================================================================================================
*/
CREATE PROC [Name of Stored Procedure]
(
   @pParameterName    VARCHAR(10)
 , @pXPM_UserName     VARCHAR(30) = NULL
 , @pXPM_TransactionID UNIQUEIDENTIFIER = NULL
 , @pXPM_Team_Info    VARCHAR(MAX) = NULL
)
AS
   BEGIN
      SET NOCOUNT ON;

      
      DECLARE @SP_ID  BIGINT
            , @PROCID)
   END;

You will receive the following error: Error refactoring unicode strings.

It looks like it doesn't even have to be within a stored procedure. This fails also:

USE master;
GO


      
      DECLARE @SP_ID  BIGINT
            , @PROCID)


This is a big issue considering our environment has logging constructs in our stored procedures that use sysname. This means I can't format any of our existing stored procedures.
Tagged:

Comments

Sign In or Register to comment.