Ich erhalte eine Ausnahme von Dapper Bulk Copy
sieht so aus, als ob der zugrunde liegende Dapper Bulk Copy
fehlschlägt. Ich habe die Daten in json gespeichert und festgestellt, dass das Problem bei der Wertschöpfung 259815703.3430760631
StackTrace:
at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata, Boolean isNull, Boolean& isSqlType, Boolean& coercedToDataFeed)
.....
Inner Exception 1:
InvalidOperationException: The given value of type Decimal from the data source
cannot be converted to type decimal of the specified target column.
Inner Exception 2:
ArgumentException: Parameter value '259815703.34307606' is out of range
Die Tabelle hat eine decimal(18,6)
und statt mit geringerer Genauigkeit zu speichern, wirft die API.
Ich habe Folgendes versucht und es funktioniert, der Wert, der gespeichert wird, ist 6 Dezimal anstelle von 10, wie erwartet
CREATE TABLE #t1(c1 DECIMAL(18,6))
INSERT INTO #t1(c1) values(259815703.3430760631)