开发者

SQL query parsing in vb.net

开发者 https://www.devze.com 2023-02-01 12:33 出处:网络
I already searched a lot of resources on the net for parsing. Parsing in integers, parsing in char, parsing in string. However I just can\'t create a program that will parse a SQL Query and do convers

I already searched a lot of resources on the net for parsing. Parsing in integers, parsing in char, parsing in string. However I just can't create a program that will parse a SQL Query and do conversion

For example, MySQL to MsSQL.

Does anybody have some sample query conversion code or relaven开发者_如何学Ct links?


SQL conversion from one database to another is quite complicated, there are lots of things to do such as data type conversion, different syntax of functions, propriety join syntax and stored procedure is much more difficult to convert.

Here are two articles with real demo to do some SQL query conversion.

  1. Rewrite Oracle propriety joins to ANSI SQL compliant joins.
  2. Rewrite SQL Server proprietary joins to ANSI SQL compliant joins.


Microsoft provides some guidelines for migrating from other databases to their products. You can download documents from their site which will assist you in the necessary conversions for your queries. Migration to Microsoft SQL Server 2008. The guides are word documents that you can download.


You could use Antlr or a similar tool. There is an almost ready-to-use MySQL grammar for Antlr, see http://www.antlr.org/grammar/list

Adding a vb.net target to Antlr will not be that easy, but I suppose you'd be just fine with an existing C# backend.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号