Exemplo n.º 1
0
        public void Execute()
        {
            _sql.AppendFormat(
                "{0} {1} {2}{3}",
                _statement.IsAlter ? "ALTER" : Constants.Create,
                _statement.IsShortForm ? "PROC" : "PROCEDURE",
                _statement.Name,
                _statement.HasBracketedArguments ? " (" : String.Empty
                );

            if (_statement.Arguments.Any())
            {
                var formatter = new VariableDefinitionFormatter(_statement.Arguments, this, _sql);
                formatter.Execute();
            }

            _sql.AppendLine();

            if (_statement.HasBracketedArguments)
            {
                _sql.AppendLine(")");
            }

            _sql.AppendLine("AS");

            FormatStatement(_statement.Definition);
        }
Exemplo n.º 2
0
        public void Execute()
        {
            IndentAppend("DECLARE");

            var formatter = new VariableDefinitionFormatter(_statement.Definitions, this, _sql);

            formatter.Execute();
        }