Posts

Showing posts with the label Dynamics Nav

BLOB To String, SQL Server

Answer : Problem was apparently not the SQL server, but the NAV system that updates the field. There is a compression property that can be used on BLOB fields in NAV, that is not a part of SQL Server. So the custom compression made the data unreadable, though the conversion worked. The solution was to turn off compression through the Object Designer, Table Designer, Properties for the field (Shift+F4 on the field row). After that the extraction of data can be made with e.g.: select convert(varchar(max), cast(BLOBFIELD as binary)) from Table Thanks for all answers that were correct in many ways! The accepted answer works for me only for the first 30 characters. This works for me: select convert(varchar(max), convert(varbinary(max),myBlobColumn)) FROM table_name It depends on how the data was initially put into the column. Try either of these as one should work: SELECT CONVERT(NVarChar(40), BLOBTextToExtract) FROM [NavisionSQL$Customer]; Or if it was just varchar ... ...