mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
This commit is contained in:
@@ -89,10 +89,19 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData
|
|||||||
{
|
{
|
||||||
Column smoColumn = smoResult.Columns[i];
|
Column smoColumn = smoResult.Columns[i];
|
||||||
|
|
||||||
// The default value may be escaped
|
string defaultValue = null;
|
||||||
string defaultValue = smoColumn.DefaultConstraint == null
|
try
|
||||||
? null
|
{
|
||||||
: FromSqlScript.UnwrapLiteral(smoColumn.DefaultConstraint.Text);
|
// The default value may be escaped
|
||||||
|
defaultValue = smoColumn.DefaultConstraint == null
|
||||||
|
? null
|
||||||
|
: FromSqlScript.UnwrapLiteral(smoColumn.DefaultConstraint.Text);
|
||||||
|
}
|
||||||
|
catch (PropertyCannotBeRetrievedException)
|
||||||
|
{
|
||||||
|
// This exception will be thrown when the user doesn't have view definition privilege,
|
||||||
|
// we can ignore it and use null as the default value;
|
||||||
|
}
|
||||||
|
|
||||||
EditColumnMetadata column = new EditColumnMetadata
|
EditColumnMetadata column = new EditColumnMetadata
|
||||||
{
|
{
|
||||||
@@ -113,7 +122,7 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Escape the parts of the name
|
// Escape the parts of the name
|
||||||
string[] objectNameParts = {smoResult.Schema, smoResult.Name};
|
string[] objectNameParts = { smoResult.Schema, smoResult.Name };
|
||||||
string escapedMultipartName = ToSqlScript.FormatMultipartIdentifier(objectNameParts);
|
string escapedMultipartName = ToSqlScript.FormatMultipartIdentifier(objectNameParts);
|
||||||
|
|
||||||
return new EditTableMetadata
|
return new EditTableMetadata
|
||||||
|
|||||||
Reference in New Issue
Block a user