I export a column of type
image to files using this command:
EXEC master..xp_cmdshell 'BCP "SELECT file_name FROM file_table WHERE id = 11 " queryout "C:\bcpdir\test.xml" -T -N'
In SQL Management Studio, I can see the hex value of the field starts with
0x3C3F786D6C which is correct for an XML file (
However, the command above seem to add an 4 byte header to the file. How can I use BCP without this header?