What are all possible first words of SQL statements?
I am creating a UI to be able to execute SQL queries against a SQL Server database, compatible with SQL Server 2008 R2. I need to determine if each statement can return a dataset, or if it just needs to be executed. In Delphi, TADOQuery
consists of either Open
/ Close
for a dataset or ExecSQL
for execution. I need to automatically detect which one to use based on the first word (s) of the SQL statement.
How do I determine which method I should call based on the first word (s) in the statement? I need to know every possible word and which method is based on each word.
source to share