I am using Microsoft SQL Server 2008 R2. I have a varbinary column RelatedData_img in the table Reminderimage. In that column I store Word, Excel files, images (png, bmp or jpg format) or text files etc. Now I want to store data from that column to a disk using command. But the problem is I dont know in which row which file is saved. I want to extract all the contents of 'RelatedData_img' at a stretch.
I have tried to use this BCP command:
Initially I create a format file using,
Text
BCP '+QUOTENAME(DB_NAME())+'.dbo.test format nul -T -N -f "C:\Temp\xyz.fmt" -S PCname\SQLMANAGEMENT,25222 -Utest -Ptest
next i use the second command to extract data from varbinary column,
Text
BCP "SELECT TOP 1 RelatedData_img FROM Reminderimage.dbo.Reminderimage" QUERYOUT "D:\testing6" -T -fC "C:\Temp\xyz.fmt" -S...