Tags: binary, code, extract, file, net, programming, server, sql, stored, t-sql

Extract a binary file in T-SQL

On Programmer » SQL

3,423 words with 2 Comments; publish: Wed, 28 May 2008 23:35:00 GMT; (20078.13, « »)

Hello,

I'm in need of finding out a way to extract a binary file that's

stored in SQL Server 2005 using T-SQL, not .NET code.

I understand that Microsoft included an executable called textcopy.exe

in SQL Server 2000, but I can't seem to find it in SQL Server 2005. Is

there any equivalent tool in SQL Server 2005 to textcopy.exe? I'm

needing this solution to distribute an extended stored procedure

written by third party.

I would like to pursue this route because I would like to make the

installation more seamless without having to ask Windows

authentication.

TIA

All Comments

Leave a comment...

  • 2 Comments
    • sp_OACreate and other methods. Just script what you want to do and you

      can either use COM or you can use a series of BAT commands. If you

      prefer commandline then just use xp_cmdshell and call what you would

      like. Of course, you could create your own extended stored procedure.

      On Tue, 14 Aug 2007 16:32:48 -0000, Hayato Iriumi <hiriumi.sql.todaysummary.com.gmail.com>

      wrote:

      >Hello,

      >I'm in need of finding out a way to extract a binary file that's

      >stored in SQL Server 2005 using T-SQL, not .NET code.

      >I understand that Microsoft included an executable called textcopy.exe

      >in SQL Server 2000, but I can't seem to find it in SQL Server 2005. Is

      >there any equivalent tool in SQL Server 2005 to textcopy.exe? I'm

      >needing this solution to distribute an extended stored procedure

      >written by third party.

      >I would like to pursue this route because I would like to make the

      >installation more seamless without having to ask Windows

      >authentication.

      >TIA

      #1; Wed, 28 May 2008 23:36:00 GMT
    • Hello,

      Thank you for your reply.

      I understand that I could use sp_OACreate and xp_cmdshell as long as

      they are enabled on SQL Server 2005, but what I'm looking for is a way

      to extract byte array in a table and retrieve a file on the SQL Server

      itself. The binary file is the extended stored procedure (DLL) that

      was written by a third party. I wonder if using .NET language within

      SQL Server 2005 may solve this issue?

      On Aug 14, 1:00 pm, beginthreadex <beginthrea....sql.todaysummary.com.gmail.com> wrote:

      > sp_OACreate and other methods. Just script what you want to do and you

      > can either use COM or you can use a series of BAT commands. If you

      > prefer commandline then just use xp_cmdshell and call what you would

      > like. Of course, you could create your own extended stored procedure.

      > On Tue, 14 Aug 2007 16:32:48 -0000, Hayato Iriumi <hiri....sql.todaysummary.com.gmail.com>

      > wrote:

      >

      > >Hello,

      > >I'm in need of finding out a way to extract a binary file that's

      > >stored in SQL Server 2005 using T-SQL, not .NET code.

      > >I understand that Microsoft included an executable called textcopy.exe

      > >in SQL Server 2000, but I can't seem to find it in SQL Server 2005. Is

      > >there any equivalent tool in SQL Server 2005 to textcopy.exe? I'm

      > >needing this solution to distribute an extended stored procedure

      > >written by third party.

      > >I would like to pursue this route because I would like to make the

      > >installation more seamless without having to ask Windows

      > >authentication.

      > >TIA- Hide quoted text -

      > - Show quoted text -

      #2; Wed, 28 May 2008 23:37:00 GMT