SQL Prompt formatting error
AshlinF
Posts: 3 New member
in SQL Prompt
Hello, ever since the most recent update to SQL Prompt, one specific stored proc that I'm working on keeps throwing this error when attempting to run the formatter:
Exception value cannot be null. parameter name: key
Changing the style used does not make a difference, and another recently created stored proc does not trigger this problem. The SP in question can be executed without issues, it's not a syntax error in the query.
By commenting out blocks of code, I was able to narrow down the cause (at least one cause) to a chunk inside a WHERE statement that looks like this:
Exception value cannot be null. parameter name: key
Changing the style used does not make a difference, and another recently created stored proc does not trigger this problem. The SP in question can be executed without issues, it's not a syntax error in the query.
By commenting out blocks of code, I was able to narrow down the cause (at least one cause) to a chunk inside a WHERE statement that looks like this:
DROP TABLE IF EXISTS #test;
CREATE TABLE #test
(
id INT IDENTITY
, stuffing VARCHAR(10)
);
SELECT T.id
, T.stuffing FROM #test AS T
WHERE TRY_CONVERT(VARCHAR(40), T.stuffing ) IS NULL;
Answers