How to retrieve BLOB data?

  • Hi all,

    I have a table that contains resume files (text files only, word/text) stored

    in the image column in a SQL 2000 database. The data was

    stored using VB.NET. I just save some files using vb.net and streams, but is there any way to retrieve it in SQL query analyzer so that I can make sure my program works successfully?

    Thank you. 

  • ISQLw will display data in text datatypes.  There is an upper limit to what will be displayed in the result set window, so if you want to just see if it got there, you can select the column. (hexadecimal will be displayed in the case of image type).

    Or you can select datalength of the column and compare to what was pulled in.  (I use this most often to verify.)

    I've also used (simply) BCP to dump out only the contents of the image column to a file to spot check.

     

     

  • well, I never used BCP utility. I am executing the following command in SQL Query Analyzer:

    bcp "HRCHRIS.[dbo].[Mgmt_App_Resume_Table]" out "Resume.txt" -c -q -U"HRIS" -P"HRIS"

    and here's the error message:

    Server: Msg 179, Level 15, State 1, Line 1

    Cannot use the OUTPUT option when passing a constant to a stored procedure.

    Or can you tell me how to use ISQLs to display data?  Thank you.

  • BCP is a command line (DOS) utility (BCP.EXE) that exists in the same directory as isqlw.exe

    You may be able to

    master..xp_cmdshell "BCP ...command here"

    But when I said BCP, I meant only one row's values:

    BCP "SELECT imgcol FROM tablea WHERE key = 123" QUERYOUT filename.txt ...

    That will put the contents of one image column/row into one DOS file.

     

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply