mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-17 01:25:40 -05:00
Remove dropped ledger columns from Edit Data columns (#1691)
* remove dropped ledger columns from Edit Data columns * moving dropped ledger filtering to column retrieval from SMO * fix clear and initialize placement and retrieve DefaultConstraintName
This commit is contained in:
@@ -93,6 +93,10 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData
|
||||
throw new ArgumentOutOfRangeException(nameof(objectNamedParts), SR.EditDataObjectNotFound);
|
||||
}
|
||||
|
||||
// Filter out dropped ledger columns from the list of columns to be returned
|
||||
// and grab the specific column properties checked below
|
||||
smoResult.Columns.ClearAndInitialize("[(@IsDroppedLedgerColumn=0)]", new [] { nameof(Column.DataType), nameof(Column.DefaultConstraintName) });
|
||||
|
||||
// Generate the edit column metadata
|
||||
List<EditColumnMetadata> editColumns = new List<EditColumnMetadata>();
|
||||
for (int i = 0; i < smoResult.Columns.Count; i++)
|
||||
@@ -103,7 +107,7 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData
|
||||
try
|
||||
{
|
||||
// The default value may be escaped
|
||||
defaultValue = smoColumn.DefaultConstraint == null
|
||||
defaultValue = string.IsNullOrEmpty(smoColumn.DefaultConstraintName)
|
||||
? null
|
||||
: FromSqlScript.UnwrapLiteral(smoColumn.DefaultConstraint.Text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user