protected void AppendUpdateParameter(SPColumn column) { if (!column.IsKey) { _stringBuilder.AppendFormat("{0} = @{0}", column.Column.Name); } }
private SPColumn IsKeyOrIdentityColumn(Column column) { SPColumn sqlColumn = new SPColumn(); sqlColumn.Column = column; sqlColumn.IsKey = false; sqlColumn.IsIdentity = false; /* TODO * foreach (LogicalReference r in column.References) * { * if (r is Key) * { * if (r.Parent is PrimaryKeyConstraint) * { * sqlColumn.IsKey = true; * _keyColumn = sqlColumn; * break; * } * * if (r.Parent is IdentityConstraint) * { * sqlColumn.IsIdentity = true; * _identityColumn = sqlColumn; * break; * } * } * }*/ return(sqlColumn); }
public SPColumnsBuilder(Columns columns, bool bAppendSeparator) : base(bAppendSeparator) { foreach (Column column in columns.ColumnList) { _columns.Add(IsKeyOrIdentityColumn(column)); } if (columns.Parent != null && columns.Parent is Table) { _table = (Table)columns.Parent; } else if (columns.Parent == null) { MessageEngine.Global.Trace(Severity.Error, Resources.ParentIsNull, columns.ToString()); } else { MessageEngine.Global.Trace(Severity.Error, Resources.ColumnsParentIsNotTable, columns.Parent.Name); } _identityColumn = null; _keyColumn = null; }
protected void AppendExecArgument(SPColumn column) { _stringBuilder.AppendFormat("\t\t@{0}{1}", column.Column.Name, column.IsKey ? " OUTPUT" : ""); }
protected void AppendParameter(SPColumn column) { _stringBuilder.AppendFormat("\t@{0} {1} {2}", column.Column.Name, column.Column.Type, column.IsKey ? "OUTPUT" : ""); }
private SPColumn IsKeyOrIdentityColumn(Column column) { SPColumn sqlColumn = new SPColumn(); sqlColumn.Column = column; sqlColumn.IsKey = false; sqlColumn.IsIdentity = false; /* TODO foreach (LogicalReference r in column.References) { if (r is Key) { if (r.Parent is PrimaryKeyConstraint) { sqlColumn.IsKey = true; _keyColumn = sqlColumn; break; } if (r.Parent is IdentityConstraint) { sqlColumn.IsIdentity = true; _identityColumn = sqlColumn; break; } } }*/ return sqlColumn; }