
A few years ago I published an article showing you can use a GP Power Tools custom RW Function to execute a SQL query and return data to a report. This article used some techniques which were valid at the time and while they still work, there are better and faster methods available in the later GP Power Tools builds.
Here is the link to the original article:

