I have to build a dynamic WHERE Clause within a SQL Stored Procedure. All of my SQL is native...meaning at this point it is NOT dynamic. I am wondering if I can build my WHERE clause based on the parameters that are provided. Right now I have this...
IS NOT NULL
SET@SQLWhereString1='WHEREGRPSPAN.GROUP_NBR=' + '''' + @GroupNbr + ''''; END
And then I have in my WHERE clause...
And that is highlighting with the error...
"An expression of non-boolean type specified in a context where a condition is expected."
Any help is greatly appreciated and Thanks in advance for your review and am hopeful for a reply.