Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
msridhar4u
Starting Member
2 Posts |
Posted - 2005-05-24 : 08:04:14
|
| Hi friends, I have been trying to develop a tool for parsing SQL/PLSQL Query’s. It is something like our Query analyzer. When we open Query analyzer we find tick mark beside run (F5) . That is when we press CTL+F5 in SQL Server QA the text that is written in the window is check for syntax. I need to implement that feature in one of our tools used in our project. I tried to find the SQL Server Components with which i can develop the tool but could not find, Could any one please tell what are the components or give some idea how to go about it.Thank you, |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2005-05-24 : 08:07:47
|
| If you run SQL Profiler while you press the check syntax button in Query Analyzer you'll see something interesting.Query Analyzer issues a SET PARSEONLY ON statement to the server, then executes the code, then issues a SET PARSEONLY OFF statement.So the batch is sent to SQL Server, the server parses the code, but doesn't execute. It will throw an error if the code doesn't look right.You can do the same thing in your tool.DamianIta erat quando hic adveni. |
 |
|
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2005-05-24 : 12:38:18
|
| Although, you should note that PLSQL (a.k.a. Oracle) uses a different variation on SQL syntax than SQL Server (T-SQL) does. For example, in PLSQL, the concatenation character is || whereas in SQL Server it is +. So you won't be able to use this technique to parse your PLSQL queries. Perhaps Oracle has a similar feature, but you'll need to pass it off to Oracle's engine then.---------------------------EmeraldCityDomains.com |
 |
|
|
msridhar4u
Starting Member
2 Posts |
Posted - 2005-05-25 : 05:03:10
|
| Hi friendsMy requirement as of now is to develop the tool only for SQL Server. Anyhow as you have told to use set parse only command, then in this case I need to connect to database, which I do not want to. For example the code reviewer would not have SQL Server at all. I want to know is there any other way of doing this or any third party .dll component which I can use or otherwise any SQL Server component like SQLDMO. But in SQL DMO I could not find the class or functions, which I use. I am trying but not able to find any till now. If any one has solution please do post it. It’s urgent for my project . Thank you, |
 |
|
|
|
|
|
|
|