Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15694

Cannot retrieve proper file

$
0
0
Hi,
I save one png file to the table column with image type, using SS 2012, like
update web_schema.dbo.user_master
set photo_file=(SELECT *
FROM OPENROWSET(BULK N'C:\t93.png', SINGLE_BLOB) AS SRC);

but after I've retrieved it by
declare @bcpCommand varchar(500)
SET @bcpCommand = 'bcp "SELECT photo_file FROM web_schema.dbo.user_master WHERE user_id = 1" queryout "C:\Program Files\Microsoft SQL Server\MSSQL11.SS2012\MSSQL\DATA\file1.png" -S WIN-BVDIC8GIAHI\ss2012 -T -c'
EXEC master..xp_cmdshell @bcpCommand

I then cannot open the relevant file by Mspaint, in Win 08 server.

Many Thanks & Best Regards, Hua Min



Viewing all articles
Browse latest Browse all 15694

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>