If you decide to go this route, you can do the following:
set showplan_xml on go set noexec on go select * from sysobjects go set noexec off go set showplan_xml off go
This will return three result sets containing one XML column. The second result set is the query plan for the actual query (in this case, select * from sysobjects )
But, as noted in my comment, you would be better off not allowing users to make any changes.
It is also possible to create applications that are selected only "only", but also quite malicious. I could easily write a selection that locks every table in the database and takes an hour.
Damien_The_Unbeliever
source share