verfiy a query like Query Analyzer's parse query function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I thought that the parse query feature in Query Analyzer simply wrapped your
statement in a TRAN and then issued a ROLLBACK statement to prevent making
real changes... but i just had a query parse successfully (ctrl-F5) and then
fail on execution(F5), due to a lack of permissions on the object.

Parse must simply verify syntax... not a simple task when you think about it.

Has anyone every tried to simulate this? My first thought would be a regex,
but my head hurts to even think about it.

Any suggestions or links?

kevin
 
Kevin,

There used to be a parser that shipped with SQL Server 2000 which would
parse apart the keywords for SQL queries (for Oracle syntax and for SQL
Server syntax). However, there is little documentation to indicate just
*how* it is parsed.

However, a general search for SQL parser on google turned up a number of
results, some of which I am sure can be converted or used in .NET.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top