I am supporting an application which stores Geometry values in tables for use with Spatialware this was before SQL Server 2008 and the inbuilt Spatial functions - I am using:
Microsoft SQL Server 2005 - 9.00.5000.00 (X64)
Dec 10 2010 10:38:40
Copyright (c) 1988-2005 Microsoft Corporation
Standard Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)
We have moved between different versions of a program called "Mapinfo" and have found that something has changed between these two versions which has caused the spatial data written back to SQL Server (to a Text column) to change. This has had a knock-on affect on another process, causing it to fail.
So, my question is - given binary data in a Text type field in SQL server, is it possible to "Fix" a changed (I assume header) in the record; i.e.
In this order – original shape, modified in mapinfo 9.5, modified in mapinfo 10.5
0x01070000000100000001030000000100000005000000 B3B0EEFF370F234117045FF6EF990141DF4B2900C81 - WORKS OK
0x01070000000100000001030000000100000004000000 B3B0EEFF370F234117045FF6EF990141DF4B2900C81 - WORKS OK
0x0107000000010000000 4000000 B3B0EEFF370F234117045FF6EF990141DF4B2900C81 - FAILS
I hope the above is clear. The missing section in the 3rd line appears to be "103000000010000000" which is the only change in the binary representation of the data between the two software versions - it is this missing data which is causing other processes to fail.
Is it possible to insert binary data in an existing text column, into existing binary data (text type) stored in there, to an offset, to make the 3rd line above look like the 2nd line?
I have looked at the .write and updatetext commands but don't seem to be getting anywhere fast.. Any pointers would be much appreciated.