- 修复 InsertDict SqlServer 下的问题;

This commit is contained in:
2881099
2023-03-15 21:09:59 +08:00
parent 09664cb3ad
commit 357e52a59f
4 changed files with 30 additions and 11 deletions

View File

@ -118,7 +118,16 @@ namespace FreeSql.Dameng
{
if (value == null) return "NULL";
if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
if (type == typeof(byte[])) return $"hextoraw('{CommonUtils.BytesSqlRaw(value as byte[])}')";
if (type == typeof(byte[]))
{
var valueBytes = value as byte[];
if (valueBytes != null)
{
if (valueBytes.Length < 2000) return $"hextoraw('{CommonUtils.BytesSqlRaw(valueBytes)}')";
var pam = AppendParamter(specialParams, $"p_{specialParams?.Count}{specialParamFlag}", col, type, value);
return pam.ParameterName;
}
}
return FormatSql("{0}", value, 1);
}
}