Fix support for SQL DW in Edit Data scenarios (#379)

- SQL DW does not support SESSIONPROPERTY. Verified that the correct return values are "true" for both values on all DW instances
This commit is contained in:
Kevin Cunnane
2017-06-13 12:39:10 -07:00
committed by GitHub
parent 58f438176b
commit 05771592d9

View File

@@ -512,6 +512,14 @@ SET NUMERIC_ROUNDABORT OFF;";
Tuple<string,bool>[] sessionSettings = new Tuple<string,bool>[2]; Tuple<string,bool>[] sessionSettings = new Tuple<string,bool>[2];
IDbConnection connection = originalCommand.Connection; IDbConnection connection = originalCommand.Connection;
if (IsSqlDwConnection(connection))
{
// SESSIONPROPERTY is not supported. Use default values for now
sessionSettings[0] = Tuple.Create("ANSI_NULLS", true);
sessionSettings[1] = Tuple.Create("QUOTED_IDENTIFIER", true);
}
else
{
using (IDbCommand localCommand = connection.CreateCommand()) using (IDbCommand localCommand = connection.CreateCommand())
{ {
// Executing a reader requires preservation of any pending transaction created by the calling command // Executing a reader requires preservation of any pending transaction created by the calling command
@@ -529,9 +537,10 @@ SET NUMERIC_ROUNDABORT OFF;";
Debug.Assert(false, "Reader cannot be empty"); Debug.Assert(false, "Reader cannot be empty");
} }
} }
return sessionSettings;
} }
} }
return sessionSettings;
}
private void SetSessionSettings(IDbConnection connection, params Tuple<string, bool>[] settings) private void SetSessionSettings(IDbConnection connection, params Tuple<string, bool>[] settings)
{ {