tsql-parser

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

十年热恋 提交于 2019-12-12 02:09:07
问题 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 PROCEDURE CREATE TABLE/TRIGGER/VIEW ALTER TABLE/TRIGGER/VIEW DROP TABLE/TRIGGER/VIEW etc What is the best way to parse the .sql file and just get the list of objects(Proc/Table/View names) and the action that is being taken on them (ALTER/CREATE/DROP