You can get stuff in very easily using the plethora of examples, however
using T-SQL to get the record out is not possible, perhaps because of the
need to isolate the field value and deal with it separately. If you were to
create a clr function using the info available for c# code then you would
have means to do it via SQL server.

I played with the idea of using bcp, but it corrupted the binary. Perhaps
as bcp expects a tabulated output it adds termination values to the file .

eg.
declare @sql varchar(8000)
select @sql = 'bcp "SELECT TOP 1 blob FROM mydatabase.dbo.Myblob" queryout
c:\Temp\Mydump.txt -n -T -S MyServer\MyInstance'
exec master.. xp_cmdshell @sql

this might work for you if the records were plain text.


Regards, Stuart



On 12 May 2012 23:33, Peter Maddin <petermad...@iinet.net.au> wrote:

> I have found examples of how to use T-SQL to insert a file as a Filestream
> blob in SQL Server 2008.****
>
> ** **
>
> I have not been successful at finding out how to use just T-SQL to select
> the same blob data to a local file.****
>
> All the examples I have seen are code based (C# etc.). Is it possible just
> to use T-SQL to persist a FileStream blob to a local file?****
>
> ** **
>
> *Regards Peter Maddin*
>
> ****
>
>  ****
>
> ** **
>



-- 
-----------------------------------------------------------------------------
Stuart Kinnear
Mobile: 040 704 5686.   Office: 03 9589 6502

SK Pro-Active! Pty Ltd
acn. 81 072 778 262
PO Box 6117 Cromer, Vic 3193. Australia

Business software developers.
SQL Server, Visual Basic, C# , Asp.Net, Microsoft Office.
-----------------------------------------------------------------------------

Reply via email to