H
hclugano
Hi!
There is a SQL Create Table statement, for example:
CREATE TABLE [dbo].[EM5Auftrag] (
[ID] [int] IDENTITY (1, 1) NOT NULL,
[Nummer] [int] NOT NULL,
[Auftrag] [varchar] ( 15) NOT NULL
.....
) ON [PRIMARY]
The Syntax isn't always the same. But it's always a correct SQL-Syntax.
For example the [ and ] are optionally or the new lines are on other
places, no tabs and so on.
I have to write a parser, which is able to find all attributes and
their properties (id, int, identity (1,1), not null). For each of this
attributes I need an Object (the class exists).
How can I find this Attributes. I tried it with a Regular Expression as
@"create table \[?dbo\]?.\[?" + Tabname + @"\]? \([!!!!!]\)"
!!!!! is the placeholder, I don't know what to write for it. Tabname is
the name of the Table. It's known.
What should I write in, for !!!!!???
If a solution with regex isn't possible, I need to find another way.
Thanks a lot!
There is a SQL Create Table statement, for example:
CREATE TABLE [dbo].[EM5Auftrag] (
[ID] [int] IDENTITY (1, 1) NOT NULL,
[Nummer] [int] NOT NULL,
[Auftrag] [varchar] ( 15) NOT NULL
.....
) ON [PRIMARY]
The Syntax isn't always the same. But it's always a correct SQL-Syntax.
For example the [ and ] are optionally or the new lines are on other
places, no tabs and so on.
I have to write a parser, which is able to find all attributes and
their properties (id, int, identity (1,1), not null). For each of this
attributes I need an Object (the class exists).
How can I find this Attributes. I tried it with a Regular Expression as
@"create table \[?dbo\]?.\[?" + Tabname + @"\]? \([!!!!!]\)"
!!!!! is the placeholder, I don't know what to write for it. Tabname is
the name of the Table. It's known.
What should I write in, for !!!!!???
If a solution with regex isn't possible, I need to find another way.
Thanks a lot!