473,890 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

looking for a T-SQL Parser for .NET

Hi,

sorry for the cross-post but I'm a bit unsure on which side of the line
I could find such things. I'm looking for a T-SQL Parser in .NET that
produces an abstract syntax tree. Ideally it should also be able to
parse Stored Procedures as well. I would hate to have to write one
myself but would be willing to continue the work on it in case someone
has already started working on it.

Thanks for any input,

Eduard Ralph

Apr 18 '06
15 6611
See

http://www.activequerybuilder.com/ for an SQL query tree parser
(visual)
www.sqlparser.com for a textual query parser
and

http://www.sqlserverce ntral.com/columnists/awarren/trythesqlparser objecttocoloriz eyoursql!.asp
for info/use on SQLPARSER.DLL

maybe also look at http://www.promptsql.com

DM Unseen

Apr 19 '06 #11
There are indeed many toy or half-baked SQL parsers out there. It may be
interesting to play with them just for the fun of it. But you can't really
use them in any serious way. If half-baked T-SQL parser is enough (e.g. for
narrowly defined special scanrios), one could just settle for some simple
regular expressions.

Linchi

"DM Unseen" wrote:
See

http://www.activequerybuilder.com/ for an SQL query tree parser
(visual)
www.sqlparser.com for a textual query parser
and

http://www.sqlserverce ntral.com/columnists/awarren/trythesqlparser objecttocoloriz eyoursql!.asp
for info/use on SQLPARSER.DLL

maybe also look at http://www.promptsql.com

DM Unseen

Apr 19 '06 #12
Most sql parsers use contect free grammars and not regular expressions,
So that would be an improvement anyway.
I know SQL parisng is actually a mess, but this because SQL as a
(sub)language is a mess.

DM Unseen

Apr 19 '06 #13
PJ6
"Jamie Collins" <ja**********@x smail.com> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .

Linchi Shea wrote:
I don't think it returns you a parse tree for further processing.


No but I was replying to PJ6, whose goal is 'colored text', for which
SQLPARSE.DLL works fine.

Jamie.


D'oh. Time to revisit my thick client query tools!

Thanks,
Paul
Apr 19 '06 #14

I wrote an app I call dot400 that can grab data from an iSeries DB2
database and put it in a DataGrid (I might put it up on CodeProject some
day).

Any way, my parsing is simple, but maybe you can build on it:
private void SQLExecuteButto n_Click(object sender, System.EventArg s e){

string[] sqlStatementPar t = new string[100];
sqlStatementPar t = sqlStatement.Te xt.Split(' ');

if(sqlStatement Part[0].ToString().ToU pper()=="SELECT ")
fillDataGrid(pr ocessSqlRequest (sqlStatement.T ext,1));
else
processSqlReque st(sqlStatement .Text,0);
}
iDB2DataReader processSqlReque st(string qs, int q)
{
string connString = ConfigurationSe ttings.AppSetti ngs["as400Dsn"];

iDB2DataReader iread = null;
iDB2Connection iconn = new iDB2Connection( connString);
iDB2Command icmd = new iDB2Command(qs, iconn);
DataSet sourcedata = new DataSet();

try
{
iconn.Open();
if(q==1)
iread = icmd.ExecuteRea der();
else
icmd.ExecuteNon Query();
}
catch ( Exception e )
{
Debug.WriteLine (e.ToString());
errorBox.Text=( e.ToString());
}
return iread;
}


go****@eduard-ralph.de wrote:
Hi,

sorry for the cross-post but I'm a bit unsure on which side of the line
I could find such things. I'm looking for a T-SQL Parser in .NET that
produces an abstract syntax tree. Ideally it should also be able to
parse Stored Procedures as well. I would hate to have to write one
myself but would be willing to continue the work on it in case someone
has already started working on it.

Thanks for any input,

Eduard Ralph

Apr 19 '06 #15
I would like to thank you DM Unseen, Linchi Shea and John A. Bailo for
your input.

Eduard

Apr 20 '06 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
3091
by: Chris Lott | last post by:
I already use and am happy with a variety of text editors (vim, emacs, ultraedit, jedit, Homesite) depending on my needs, but I would like recommendations for a PHP specific IDE that will run on Windows XP. Specifically I am looking for something that can help with debugging, provides efficient code browsing (functions, objects, etc) across multiple files in a project, easy browsing through proper mappings to a development server/local...
14
2587
by: Jason Daly | last post by:
I'm a freshman at college as a computer science major. I'm not sure it has what I want. Does anyone know if a major commonly exists in web design (focusing in server side languages)? I want to program for the internet, but don't know where to get all of my information from to be the most knowledgeable I can be. Do i find what i'm looking for in some class somewhere? if so where do i look? or do i just buy all the asp, php, xml, etc...
4
3633
by: Frank Einstein | last post by:
Looking for a tool that can edit an XML file in a browser. The basic requirement is that the XML file is rendered as an HTML form with editable fields (including add/delete, preferably in accordance with with the document's XSD/DTD or other schema definition). I don't mind the actual form of this tool - could be implemented as a JSP/Servlet, ASP component, or browser plug-in for local or remote XML file access. Alternatively, it doesn't...
51
8003
by: Matt | last post by:
Hello, I'm a hiring C++ developer employer looking for existing, online C++ aptitude tests. I have not yet extensively researched this yet, but as an example, I thought this test looked pretty good: http://expertrating.com/c++test.asp
1
1599
by: marklinehan | last post by:
Hi, my name is Mark Linehan. About 20 years ago or so I started learning how to program on the Commodore 64 computer (anyone remember those?) heheheh. I taught myself basic on this little machine to the point that there was nothing I could not do in basic on the 64 and started learning assembly language on it. I moved up to the Amiga, and dabbled in C. Then moved to an IBM 386. At that time I literally knew plain old MS-DOS version(s) of...
2
1568
by: Matt | last post by:
Hi, I am looking for a control that will allow me to host other controls inside it but have a method of showing and hiding. I have seen plenty of horizontal controls for doing this but I am looking for a vertical one. I would like to host my navigation tree in it on the left side of my web site and allow the user to hide and show it as needed to give me more visible real estate. I visualize something like when it is closed it has a small tab...
11
2365
by: matsi.inc | last post by:
I am looking to make something like a delegate that i can use in my projects but am having a hard time getting started. The behavior I am most interested in is how a delegate changes it's Invoke method dynamically to match the arguments supplied to it when it is defined. For example... public delegate void MyDelegate(string myString, int myInt);
12
2418
by: amogan | last post by:
**If interested & qualified, please reply with your resume directly to amogan@google.com** Referrals are always welcome!! Network System Test Engineer - Mountain View This position is available in Mountain View, CA.
6
2331
by: beantaxi | last post by:
Hello all, I'm looking for a very simple code analysis tool. I have a large codebase to analyze, and all I really need to do is to find all uses of all methods in a few interfaces. Many tools (e.g. Resharper) obviously do this internally, but I can't seem to find any that expose this simple functionality. Command line would be fine -- in fact I'd prefer that but its not necessary.
2
1065
by: cowznofsky | last post by:
My needs are relatively simple. I'm putting together a web site prototype that has some very minimal e-commerce type stuff. I've been away from asp.net for a little while. It's not a store, so I'm not looking for that specific functionality. It will include to facility to maintain a product list. I'm looking for a starter kit that will hande users in different roles, and allow them self-service to maintain their contact information...
0
9826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10829
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7171
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6058
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4682
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.