what is the equivalent of EXPLAIN form SQLite in SQL Server?

Gabriel Diaconescu picture Gabriel Diaconescu · Feb 2, 2011 · Viewed 8.8k times · Source

I used an SQLite database and run an EXPLAIN statement before executing the actual query to verify if there was any attempt to write on the database.

Now, we have migrated to SQL Server and I need to know if a query tries to write on the database or is just a simple SELECT statement. I basically try to avoid any malicious statement.

Answer

Oded picture Oded · Feb 2, 2011

You can see the estimated query plan of any query in SSMS by clicking the estimated query plan button.

See MSDN.


However, if the user shouldn't be writing to the database, is shouldn't have the permissions to do so. Ensure it belongs to a role that has restricted permissions.