If you have an SQL connection, you can avoid the need to write an SQL parser, by using the "SET NOEXEC ON" command before executing your SQL command. This tells SQL not to execute any commands, just evaluate if they would have been executed.
SqlCommand cmd = new SqlCommand("SET NOEXEC ON", conn);
cmd.ExecuteNonQuery();
cmd = new SqlCommand(sqlToBeChecked, conn);
cmd.ExecuteNonQuery();
If no exception is thrown, all is fine.