Questions tagged [tsql-parser]

10 questions
2
votes
1 answer

SQL Server's ow "batchparser.dll" - how to use it?

Is there a documented or at least vaguely documented way to make use of the SQL Server batchparser.dll that's hidden away deep inside the SQL Server directory structure (C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn)?…
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
2
votes
0 answers

Microsoft.SqlServer.TransactSql.ScriptDom : TSqlTokenType

When parsing in a SQL query like: SELECT g.A, g.B, g.C FROM dbo.Goat g inner join dbo.Badger b on g.A=b.A and iterating through TSqlParserToken there is a Property called TokenType. I get the following: SELECT Select WhiteSpace g …
dandcg
  • 442
  • 4
  • 16
1
vote
0 answers

Getting the parent of a TSql100Parser node

Due to a lack of documentation surrounding the use of the TSql100Parser class is there any way I can determine the parent of a particular node? I am using Microsoft.Data.Schema.ScriptDom.Sql and Microsoft.Data.Schema.ScriptDom assemblies to do the…
Intrepid
  • 2,781
  • 2
  • 29
  • 54
1
vote
2 answers

Can we execute SQL without having a real database connection in java?

Can we execute SQL without having a real database connection in java? example: SELECT CASE WHEN :param = 1 THEN 'TEST1' WHEN :param = 2 THEN 'TEST2' WHEN :param = 3 THEN 'TEST3' END AS RESULT FROM…
user1097437
  • 111
  • 3
  • 12
1
vote
0 answers

Need exact Table/Column for each field returned by a select

In a database application I'll be executing a few SQL queries. But I also need some metadata from the query or the result. What I basically need is to know exactly where each field came from (Table and Column). The Algebrized Tree contains much…
1
vote
1 answer

Regular expression to detect hidden DML(insert, update, delete) statements in a DDL(create, alter, drop) .sql script

UPDATE: To make this question easier. I have changed the string and now you don't have to worry about BEGIN END at all. Instead I now have only GO statements as terminators. I hope I will get some answers from other people now I need to write…
StackThis
  • 1,262
  • 1
  • 14
  • 23
0
votes
0 answers

How to increase SQL parser speed that using TSqlParser?

In my code, I have several SQL scripts that I want to parse using TSql130Parser in order to refactor them. But this process takes a long time - is there a way to increase the speed of this? Also I have another question that TSql130Parser can get…
Maryam
  • 53
  • 8
0
votes
1 answer

How to find error on script using Microsoft.SqlServer.TransactSql.ScriptDom

I have a SQL script X Select top 1 * from table. I use MicrosoftSql.Smo to check script has error or not. The letter X is incorrect for SQL script. But it cannot find the error in the script and evaluates as true. How can I solve this problem.…
beetlejuice
  • 115
  • 1
  • 10
0
votes
0 answers

Why does Microsoft.SqlServer.TransactSql.ScriptDom.TSqlParser fail to parse a simple valid expression?

We are using Microsoft.SqlServer.TransactSql.ScriptDom heavily to process some SQL scripts. Our understanding is that the parser is supposed to be full fidelity. However, we recently found this bug: using…
Clement
  • 3,990
  • 4
  • 43
  • 44
0
votes
2 answers

RegEx to parse stored procedure and object names from DDL in a .sql file C#

I have a .sql file which may contain DDL definitions of several stored procedures, alter statements for Tables, Triggers, Views etc It could have statements like these : CREATE PROC / CREATE PROCEDURE ALTER PROC / ALTER PROCEDURE DROP PROC / DROP…
StackThis
  • 1,262
  • 1
  • 14
  • 23