The SQL is:
execute ('delete from HttpRequests where Date < ''2009-08-' + convert(nvarchar(max), 0) + '''')
The error is
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'convert'.
Commenting out the convert part removes the error. Whats wrong?
EXECUTE (@stringvariable)does not allow concatenation more complex than@stringvariable1 + @stringvariable2You’d have to do this:
However, then you have the invalid date error… and I’ve fixed the quote error too…