Currently working with Oracle, but will also need a solution for MS SQL.
I have a GUI that allows users to generate SQL that will be executed on the database. This
I dont think it is possible. Here is a link to a discussion on Oracle's website about this topic: http://forums.oracle.com/forums/thread.jspa?threadID=400492&start=15&tstart=0