Phantom spaces in listings
This behaviour is caused by \lstset{columns=fixed}
. Changing to columns=flexible
or columns=fullflexible
should make it go away.
You could always provide the SQL code as "attachments" to the PDF. Of course, that might really only work with Acrobat Reader...
I could fix this problem by setting a different monospace font:
\newfontfamily\listingsfont[Scale=.7]{DejaVu Sans Mono}
\lstset{basicstyle=\listingsfont}
(This is more or less what @Jan Hlavacek describes in his comment)