SQL Prompt 10.14.21.9884 semi-colon syntax problem
jsreynolds1
Posts: 94 Silver 2
Good morning,
I'm seeing an issue where I have a THROW in a BEGIN/END statement, and unless I preface the THROW with a semi-colon, SQL Prompt sees it as an issue.
I don't recall SQL syntax requiring a prefixed semi-colon?
SQL Prompt 10.14.21.9884
SSMS 20.1.10.0
Windows 11 latest
This is the code:
I'm seeing an issue where I have a THROW in a BEGIN/END statement, and unless I preface the THROW with a semi-colon, SQL Prompt sees it as an issue.
I don't recall SQL syntax requiring a prefixed semi-colon?
SQL Prompt 10.14.21.9884
SSMS 20.1.10.0
Windows 11 latest
This is the code:
SET NOCOUNT ON;
--
-- Validation
--
IF @type NOT IN ('gl', 'accts')
BEGIN
THROW 60000, N'Parameters not passed correctly.', 1;
RETURN;
END;
Tagged:
Answers
Sorry, to hear you're experiencing this issue!
I'm going to raise this with the developers and I'll keep you posted on further updates!
Kind regards
Dan Calver | Redgate Software
Have you visited our Help Center?
Microsoft docs: "The statement before the THROW statement must be followed by the semicolon (;) statement terminator."
Yes, even if the previous "statement" is BEGIN. So just add a semicolon in there and you will be good to go.