When I try to creat this stored procedure, I get two syntax errors:
Msg 102, Level 15, State 1, Procedure usp_maintain_database_log, Line 107
Incorrect syntax near '?'.
Msg 102, Level 15, State 1, Procedure usp_maintain_database_log, Line 111
Incorrect syntax near '#results'.
I'm not sure why.