Trim $sql before checking for SELECT
Merge pull request #3301 from ubermaniac/Sqlserver-trim

Trim $sql before checking for SELECT