Tuesday, April 16, 2013

Iterating through a SQL Server script using C#

I hope you would have read my previous blog on how to parse the SQL Server script using C#.

Once the script is parsed successfully, the entire script is available in TSqlScript object.  A TSqlScript can contain multiple TSqlBatch objects.  Each TSqlBatch object contains multiple TSqlStatement objects to it.

For each of the DDL/DML statements, there is a class associated to it (say SelectStatement, DeleteStatement, UpdateStatement etc.,).  All these classes are inherited from the main abstract class TSqlStatement.


No comments:

Post a Comment