Class SqlParser
Helper class for parsing sql statements
Inheritance
System.Object
SqlParser
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.Helper
Assembly: ETLBox.dll
Syntax
public static class SqlParser
Methods
ParseColumnNames(String)
This method attempts to parse column names from any sql statement. E.g. SELECT 1 AS 'Test', Col2, t2.Col3 FROM table1 t1 INNER JOIN t2 ON t1.Id = t2.Id will return Test, Col2 and Col3 als column names.
Declaration
public static List<string> ParseColumnNames(string sql)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | The sql code from which the column names should be parsed |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | The names of the columns in the sql |