Refactoring Error
Lszoke
Posts: 5 New member
in SQL Prompt
I get this error:
with the following script:
BEGIN
DECLARE @Supplement NVARCHAR(30) = N'%' + N'Glucosamine Complex' + N'%';
DECLARE @FromString NVARCHAR(30) = (SELECT TRIM( '%' FROM @Supplement) AS A);
DECLARE @ToString NVARCHAR(30) = N'Joint Support';
DECLARE @Reason TABLE
(
Supplement NVARCHAR(30)
, TableId INT
, ActionId INT
);
INSERT @Reason
SELECT
, T1.ActionTableId
, T1.ActionId
FROM glb.AssessmentReasons AS T1
WHERE T1.[Language] = 1
AND T1.Reason LIKE @Supplement;
-- 1) Update the asmt_Action Reasons column
UPDATE TA SET TA.Reasons = REPLACE(TA.Reasons, @FromString, @ToString)
FROM asmt_Action AS TA
JOIN @Reason AS T2 ON T2.TableId = 1 AND TA.ID = T2.ActionId
WHERE TA.ActionTableId = 1;
END;
Just upgraded to the latest v9 release.
Please note that part of the script had previously been formatted successfully with the earlier v8 product.
Win10
SQL Prompt 9.4.13.8478
SSMS v17.9.1
Best Regards,
L Szoke
Tagged:
Answers
I can reproduce it with the latest version 9.4.14. By any change do you remember which version was working?
Tianjiao Li | Redgate Software
Have you visited our Help Center?
Apologies for the inconvenience caused.
Tianjiao Li | Redgate Software
Have you visited our Help Center?
Glad you could reproduce it. The previous version was 8.2.5.2924
Regards,
Lajos Szoke
Tianjiao Li | Redgate Software
Have you visited our Help Center?
With this code:
As soon as this is commented out the rest of the code formats fine. I'm positive it's around the new Trim Function and it's parameters. Any help appreciated.
Sql Prompt Version 9.5.9.10716
SSMS Version 15.0.18131.0
SQL Server 2017, 14.0.3048.4 (x64)
Windows Server 2012 R2 Standard 6.3