mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -05:00
fix the select script gen issue for Synapse db (#1724)
This commit is contained in:
@@ -50,7 +50,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
||||
|
||||
private Dictionary<string, string> objectScriptMap = new Dictionary<string, string>();
|
||||
|
||||
internal Scripter() {}
|
||||
internal Scripter() { }
|
||||
|
||||
/// <summary>
|
||||
/// Initialize a Peek Definition helper object
|
||||
@@ -535,7 +535,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
||||
internal bool LineContainsObject(string line, string objectName, string createSyntax)
|
||||
{
|
||||
if (line.IndexOf(createSyntax, StringComparison.OrdinalIgnoreCase) >= 0 &&
|
||||
line.IndexOf(objectName, StringComparison.OrdinalIgnoreCase) >=0)
|
||||
line.IndexOf(objectName, StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -693,7 +693,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
||||
|
||||
// Check if we're called for EDIT for SQL2016+/Sterling+.
|
||||
// We need to omit temporal columns if such are present on this table.
|
||||
if (server.Version.Major >= 13 || (DatabaseEngineType.SqlAzureDatabase == server.DatabaseEngineType && server.Version.Major >= 12))
|
||||
if (server.Version.Major >= 13 || (DatabaseEngineType.SqlAzureDatabase == server.DatabaseEngineType && server.Version.Major >= 12 && !isDw))
|
||||
{
|
||||
// We're called in order to generate a list of columns for EDIT TOP N rows.
|
||||
// Don't return auto-generated, auto-populated, read-only temporal columns.
|
||||
@@ -702,7 +702,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
||||
|
||||
// Check if we're called for EDIT for SQL2022+/Sterling+.
|
||||
// We need to omit dropped ledger columns if such are present
|
||||
if (server.Version.Major >= 16 || (DatabaseEngineType.SqlAzureDatabase == server.DatabaseEngineType && server.Version.Major >= 12))
|
||||
if (server.Version.Major >= 16 || (DatabaseEngineType.SqlAzureDatabase == server.DatabaseEngineType && server.Version.Major >= 12 && !isDw))
|
||||
{
|
||||
filterExpressions.Add("@IsDroppedLedgerColumn=0");
|
||||
}
|
||||
@@ -795,7 +795,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
||||
// from clause
|
||||
selectQuery.Append(" FROM ");
|
||||
|
||||
if(server.ServerType != DatabaseEngineType.SqlAzureDatabase)
|
||||
if (server.ServerType != DatabaseEngineType.SqlAzureDatabase)
|
||||
{
|
||||
// Azure doesn't allow qualifying object names with the DB, so only add it on if we're not in Azure database URN
|
||||
Urn dbUrn = urn.Parent;
|
||||
|
||||
Reference in New Issue
Block a user