How can I stop script execution if insert value is null and set value if not null?
0
votes
1
answer
1806
views
I have tried to use Case and SET NOEXEC ON but get the following errors:
>Syntax Error: unexpected 'SET' (set)
>Syntax Error: missing 'closing parenthesis'
INSERT INTO tag (table, repr, tag, value)
SELECT 'product' AS table,
@Id AS repr,
'product_code' AS tag,
CASE @Code
WHEN NOT null THEN @Code
ELSE SET NOEXEC ON
END AS value`
@Id
and @Code
are declared parameters in the script
Asked by DBNewbie
(1 rep)
Mar 21, 2018, 05:36 PM
Last activity: Mar 26, 2018, 08:57 PM
Last activity: Mar 26, 2018, 08:57 PM