Beispiel #1
0
 protected override string ParseColumnAlter(TableColumnSchema mColumn, TableColumnSchema eColumn)
 {
     return(string.Format(@" [{0}] {1}{2} ",
                          mColumn.Name,
                          MssqlSchemaLoader.TypeDbsmToSql(mColumn),
                          mColumn.Nullable ? string.Empty : @" NOT NULL"));
 }
Beispiel #2
0
        protected override string ParseColumn(TableColumnSchema column)
        {
            var stat = new StringBuilder();

            stat.Append(MakeDdlElementName(column.Name) + " " + MssqlSchemaLoader.TypeDbsmToSql(column));

            if (column.AutoIncrement)
            {
                stat.AppendFormat(@" IDENTITY ({0},{1})", column.Seed, column.Increment);
            }
            else if (!string.IsNullOrEmpty(column.DefaultValue))
            {
                stat.Append(@" DEFAULT " + column.DefaultValue);
            }

            if (!column.Nullable)
            {
                stat.Append(@" NOT NULL");
            }

            return(stat.ToString());
        }