Have a look at listings package (http://en.wikibooks.org/wiki/LaTeX/Packages/Listings), also Google (http://www.google.co.uk/search?q=latex+listings). It supports syntax highlighting for many programming languages, including SQL, and produces very nice output.
Gleb
http://www.turbodad.com