Forum Discussion
junkyardnils
Sep 02, 2025Copper Contributor
Fail to OPENROWSET insert geometry data from parquet
Hi! I'm trying to insert geometry data (WKB) from a parquet file to a data base table. I manage to get it working for small geometries but it's failing for lager geometriers. Here is the code: INS...
carlwalk
Jan 07, 2026Copper Contributor
This one’s basically SQL Server being a little too clever for its own good. When OPENROWSET reads the Parquet file, it guesses the geometry column should be a VARBINARY(8000), and that works fine until it hits a geometry that’s bigger than 8 KB — then everything blows up with a truncation error. Nothing is actually wrong with your geometry data or STGeomFromWKB; the data is getting chopped before SQL Server even has a chance to convert it. The usual workaround is to stop SQL Server from guessing: load the data into a staging table with a VARBINARY(MAX) column (or explicitly cast it if possible) and then convert it to geometry from there. Once you do that, the inserts behave normally.