Пример #1
0
        public List<string> GenerateAddColumnStatement(AddColumn addColumn)
        {
            StringBuilder sb = new StringBuilder();
             sb.AppendFormat("ALTER TABLE {0} ADD COLUMN {1} {2} {3}", addColumn.Table, addColumn.Name, addColumn.DataType, addColumn.Nullable ? "NULL" : "NOT NULL");

             return new List<string>() { sb.ToString() };
        }
Пример #2
0
        private IStatement ParseAddColumnStatement(XmlNode statement)
        {
            AddColumn addStatement = new AddColumn();
             addStatement.Table = statement.Attributes["Table"].Value;
             addStatement.Name = statement.Attributes["Name"].Value;
             addStatement.DataType = statement.Attributes["DataType"].Value;
             addStatement.Nullable = Convert.ToBoolean(statement.Attributes["Nullable"].Value);
             addStatement.Default = statement.Attributes["Default"].Value;

             return addStatement;
        }