Skip to main content

Hi!

I am trying to write to a AZURE SQL non-spatial database, but I received the below error for just one of my layers.

"Microsoft Azure
SQL Database Non-Spatial Writer: Failed to write a feature of type `dbo.door'
to the database. Provider error `(-2147217887) Invalid character value for cast
specification'. SQL Command `INSERT INTO dbo.[door] ([id], [category],
[restriction], [ordinal], [name], [alias],
[address_id]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'"

I've checked the datatypes to see if they match and they do along with the attributes. Could this be a geometry issue? I do not know what else to check for.

Thank you for any assistance!

David

A workspace that showed the schema of the table being created plus a single sample feature that causes the error would be very helpful. Also curious if the JDBC non-spatial writer (available in FME 2018.1) does any better.

 

 


A workspace that showed the schema of the table being created plus a single sample feature that causes the error would be very helpful. Also curious if the JDBC non-spatial writer (available in FME 2018.1) does any better.

 

 

The problem has been resolved. I ended up testing by using the attributes that were already in the database to see if they could be written into the database, which they did. I then was able to find the problem child by changing each field and testing the upload. I think what the problem was there was an extra space at the end of the id field, which uses an UUID. When I added a new UUID, it went through.

 

 

Could an extra space at the end of the UUID code have caused the problem of not being entered into the SQL database?

 

 

I also tried the JDBC non-spatial writer and it did not resolve the error. I received an error code stating "SQL database Conversion failed when converting from a character string to uniqueidentifier."

 

 

Thanks,

 

David

 


The problem has been resolved. I ended up testing by using the attributes that were already in the database to see if they could be written into the database, which they did. I then was able to find the problem child by changing each field and testing the upload. I think what the problem was there was an extra space at the end of the id field, which uses an UUID. When I added a new UUID, it went through.

 

 

Could an extra space at the end of the UUID code have caused the problem of not being entered into the SQL database?

 

 

I also tried the JDBC non-spatial writer and it did not resolve the error. I received an error code stating "SQL database Conversion failed when converting from a character string to uniqueidentifier."

 

 

Thanks,

 

David

 

Yes, the extra space may have done it. Sorry for the trouble; we'll think about whether we can do better client side sanitizing in the future.

Reply