示例#1
0
        private List <CreateTableStatement> GetCreateTableStatements()
        {
            using (var script = new StringReader(_script))
            {
                var parser = new TSql120Parser(false);

                IList <ParseError> errors;

                var fragment = parser.Parse(script, out errors);

                if (fragment != null)
                {
                    var visitor = new CreateTableVisitor();
                    fragment.Accept(visitor);
                    return(visitor.Creates);
                }
            }

            return(null);
        }
示例#2
0
        private List<CreateTableStatement> GetCreateTableStatements()
        {
            using (var script = new StringReader(_script))
            {
                var parser = new TSql120Parser(false);

                IList<ParseError> errors;

                var fragment = parser.Parse(script, out errors);

                if (fragment != null)
                {
                    var visitor = new CreateTableVisitor();
                    fragment.Accept(visitor);
                    return visitor.Creates;
                }
            }

            return null;
        }