Hi,
I have been trying to extract the modeldata from the databasemodel table, but don't know what format to expect.
The documentation says compressed json, which naturally makes me think of a zip-compressed blob-file.
I have tried to export the data as a file using the below BCP-command
c:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn>bcp.exe "select ModelData from superofficetest.crm7.DATABASEMODEL where databasemodel_id = 1" queryout "d:\superoffice_media\temp\so-db-model-json.zip" -S servername -T -c -C RAW -r "" -f d:\superoffice_media\temp\bcp.fmt
##################################################
bcp.fmt - Format file for BCP
##################################################
14.0
1
1 SQLBINARY 0 0 "" 1 ModelData ""
##################################################
Result:
Warning: -f overrides -c.
Starting copy...
1 rows copied.
Network packet size (bytes): 4096
Clock Time (ms.) Total : 16 Average : (62.50 rows per sec.)
c:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn>
Result - File
Some kind of binary, but I don't know what format. It doesn't work to zip-decompress, it doesn't seem to be Base64-encoded.
The start of the file looks like this:

Comments
I know that BCP might add some extra characters in the beginning of the file, but my format settings should fix this. I have also tried another DB Tool that seem to have exported a file with the exact same content.
Question
What fileformat and compression should I expect in this blob-field?
Can anybody see any obvious errors in my extract method? Is it implicitly converted to some faulty format in the export?
Any tips on how to extract this information?
Best Regards
Marcus