You have @sZone
and @sSubCode
which are null
. Concatenation with null
is always null
.
This can make sense.
SET @sQuery='SELECT @sZone = Zone, '+
'@sSubCode = Sub_Code
FROM '+ @sImport_Table +
' WHERE Geography ='+ @c_Geography +
' AND [DayOfWeek] = '+ @c_DayOfWeek
Notice, that the DayOfWeek
is reserved word and must be included in square bracket.