Skip to main content
Question

Convert null/missing values to a SQL NULL in SQL Server action

  • April 25, 2023
  • 0 replies
  • 40 views

Forum|alt.badge.img+1

I created a sub-zap to “wrap” a SQL Server action that executes a stored procedure.  If all of the sub-zap’s arguments have a value supplied, the procedure works as expected.

However, if a given argument is null or missing, the procedure fails because the null/missing value isn’t converted to a NULL:

EXEC MyProcedure ‘A’, , ‘C’

It needs to be:

EXEC MyProcedure ‘A’, NULL, ‘C’

NULL should not be a string, either.  This is incorrect:

EXEC MyProcedure ‘A’, ‘NULL’, ‘C’

 

Any suggestions on how do correct this behavior?

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.