I am investigating a SQL injection attack issue (SQL Server database in this case). Before anyone suggests it, I know that parameterised queries are the ultimate solution but that is not going to be easy or straight forward in this legacy code, so bear with me.
The puzzle is that this (malformed) command 'batch' actually works:
select * from table1 where tableCode LIKE '' delete from table1
Now my understanding of the SQL Server documentation is that this is not a legitimate command batch because there is no semi-colon separator, so strictly speaking it should be rejected by SQL Server. However it isn't and the two commands are executed correctly, with the expected result.
Is this a case of SQL Server not conforming to its own documentation, or have I missed something?