Edit Data: Create Row with Nullable Columns (#553)

* WIP

* All the new RowCreate tests are working

* Fixing a couple bugs with the row delete and row update tests

* Regenerating localization files

* Fixing multiple iteration in tests
This commit is contained in:
Benjamin Russell
2017-11-28 14:59:48 -08:00
committed by GitHub
parent bc8aef6a15
commit 2190039df2
33 changed files with 17699 additions and 7445 deletions

View File

@@ -214,13 +214,13 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData.UpdateManagement
// Make sure a value was provided for the cell
if (cell == null)
{
// If there isn't a default, then fail
if (DefaultValues[i] == null)
// If the column is not nullable and there is no default defined, then fail
if (!column.AllowDBNull.HasTrue() && DefaultValues[i] == null)
{
throw new InvalidOperationException(SR.EditDataCreateScriptMissingValue);
throw new InvalidOperationException(SR.EditDataCreateScriptMissingValue(column.ColumnName));
}
// There is a default value, so trust the db will apply it
// There is a default value (or omitting the value is fine), so trust the db will apply it correctly
continue;
}