Error inserting into column type numeric(19,0)null
jackson33
Posts: 5
I keep receiving the error below when trying to generate data for a column of type numeric(19,0)null...
[dbo].[SqlDataGeneratorTest]
The given value of type SqlDecimal from the data source cannot be converted to type decimal of the specified
target column.
System.InvalidOperationException: The given value of type SqlDecimal from the data source cannot be converted
to type decimal of the specified target column. ---> System.InvalidOperationException: The given value of type
SqlDecimal from the data source cannot be converted to type decimal of the specified target column. --->
System.ArgumentException: Parameter value '2' is out of range. --- End of inner exception stack trace --- at
System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata) --- End of inner
exception stack trace --- at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData
metadata) at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternal() at
System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServer(Int32 columnCount) at
System.Data.SqlClient.SqlBulkCopy.WriteToServer(IDataReader reader) at az.a(CancellableController , Int32 ,
Int32 , ConnectionProperties , GenerateAction , SqlConnection , SDGProject , GenerationReport )
It would appear that 1 is a valid entry but 2 is not. Distribution is set to Sequential. Set unique is checked. Min is set at 1, max at 9,999,999,999,999,999,999.
Any help is greatly appreciated.
Tim
[dbo].[SqlDataGeneratorTest]
The given value of type SqlDecimal from the data source cannot be converted to type decimal of the specified
target column.
System.InvalidOperationException: The given value of type SqlDecimal from the data source cannot be converted
to type decimal of the specified target column. ---> System.InvalidOperationException: The given value of type
SqlDecimal from the data source cannot be converted to type decimal of the specified target column. --->
System.ArgumentException: Parameter value '2' is out of range. --- End of inner exception stack trace --- at
System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata) --- End of inner
exception stack trace --- at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData
metadata) at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternal() at
System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServer(Int32 columnCount) at
System.Data.SqlClient.SqlBulkCopy.WriteToServer(IDataReader reader) at az.a(CancellableController , Int32 ,
Int32 , ConnectionProperties , GenerateAction , SqlConnection , SDGProject , GenerationReport )
It would appear that 1 is a valid entry but 2 is not. Distribution is set to Sequential. Set unique is checked. Min is set at 1, max at 9,999,999,999,999,999,999.
Any help is greatly appreciated.
Tim
Comments
Sorry, this does seem to be a bug in Data Generator. The reference number with our development team is SDG-857, and it is being reviewed. There is no known workaround at this time, short of changing the column datatype to an integer.
talk about a pain in the butt. the tool isn't very useful if it's going to bomb on any decimal datatype column....