Red Gate forums :: View topic - Error inserting into column type numeric(19,0)null
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 1
SQL Data Generator 1 forum

Error inserting into column type numeric(19,0)null

Search in SQL Data Generator 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
jackson33



Joined: 25 Jan 2008
Posts: 5

PostPosted: Thu Apr 09, 2009 3:26 pm    Post subject: Error inserting into column type numeric(19,0)null Reply with quote

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
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6644

PostPosted: Sun Apr 12, 2009 9:31 pm    Post subject: Reply with quote

Hi Tim,

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.
Back to top
View user's profile Send private message
jackson33



Joined: 25 Jan 2008
Posts: 5

PostPosted: Thu May 14, 2009 1:46 pm    Post subject: Thanks Brian Reply with quote

Thanks for looking into Brian. Unfortunately I don't control the data type of that column. If I figure out any work arounds I'll post them up.
Back to top
View user's profile Send private message
paulj



Joined: 24 Sep 2009
Posts: 2

PostPosted: Thu Sep 24, 2009 2:50 pm    Post subject: Reply with quote

has this issue been resolved? how can I work around this without having to change the type to an integer?
Back to top
View user's profile Send private message
paulj



Joined: 24 Sep 2009
Posts: 2

PostPosted: Thu Sep 24, 2009 3:26 pm    Post subject: Reply with quote

i figured out a work around. I had to write my own random decimal UDF and then use it in a sql statement for the random generated value for the specific columns that are of type decimal.

talk about a pain in the butt. the tool isn't very useful if it's going to bomb on any decimal datatype column....
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group