I have a table of data, one column contains images. I am trying to extract an individual records image column and export to image file using BCP. My code is as follows:
bcp "SELECT PictureData FROM BigTable WHERE RecordId='ASDF-QWER' queryout "C:\Path\File.jpg" -n -SCONNECTION\STRING -T
The output after running the command appears successful, it says 1 rows copied but when I double click on the file created it says "cannot open this file". If I modify the statement to select different rows and copy them to a text file using something like:
bcp "SELECT Name,Address FROM BigTable WHERE RecordId='ASDF-QWER' queryout "C:\Path\File.txt" -n -SCONNECTION\STRING -T
Then the text file contains the data I expect it to contain