Re: BLOB

From: John A. Curry (JohnCurry_at_Captaris.com)
Date: 06/30/04


Date: Tue, 29 Jun 2004 17:52:30 -0700

Well it is amazing what you find after you post. After much searching I
found it on my own. For anyone else who may have wanted to know how to
populate a image type, there is an executable that will do it called
TextCopy.exe. A sample command line is below.

C:\MyDocs\My
Pictures>textcopy -I -Usa -PMyPassword -SMyServer -DMyDatabase -TMyTable -CI
mageColumn -W"where ID = 3" -Fsample.jpg /Z
TEXTCOPY Version 1.0
DB-Library version 8.00.194
  debug: Final parameters:
  debug: Server: MyServer
  debug: Login: sa
  debug: Password: MyPassword
  debug: Database: MyDatabase
  debug: Table: MyTable
  debug: Column: ImageColumn
  debug: Where clause: where ID = 3
  debug: File: sample.jpg
  debug: Direction: Into SQL Server from file.
  debug: Chunk size: 4096 bytes
SQL Server 'MyServer' Message 5701: Changed database context to 'master'.
SQL Server 'MyServer' Message 5701: Changed database context to
'MyDatabase'. (Concerning line 1)
  debug: Query: select ImageColumn from MyTable where ID = 3
  debug: File 'sample.jpg' opened for read
  debug: File is 9894 bytes long
  debug: Read 4096 bytes from file
  debug: Read 4096 bytes from file
  debug: Read 1702 bytes from file
  debug: File closed
Data copied into SQL Server image column from file 'sample.jpg'.

The other key I found is that the existing column must not be null. I
resolved this by running the following.

INSERT INTO [dbo].[MyTable] VALUES ('3', 0x0 )

If you don't do this you will get the following error when you run in debug
(-Z)

ERROR: Text or image pointer and timestamp retrieval failed.

There is also a stored procedure if you would like it let me know and I can
post that as well.

-John

"John A. Curry" <JohnCurry@Captaris.com> wrote in message
news:uzYznuiXEHA.2408@tk2msftngp13.phx.gbl...
> Hello,
>
> I am looking into storing images into SQL and want to use BLOB which I
> understand to be the best method. Can someone supply me with a simple
> example of how to import a file into the database?
>
> Thanks in advance,
>
> John
>
>



Relevant Pages

  • Re: testing with sql server
    ... Regarding your SQL Server 2000 debugging problems, ... version to debug with a sql server 2000 database. ... My goal is to debug some t-sql commands. ... attach to a process and the process that I need to attach to is ...
    (microsoft.public.sqlserver.setup)
  • Re: Can i debug/watch on the triggers INSERTED and DELETED records/values?
    ... > Sometimes I do debug remotely. ... we found that debugging did not work when you had Windows ... Now, port 135 is not any port: ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Debugging Windows Service
    ... I am writing a Windows Service that works with SQL Server. ... I want to be able to debug it, ... it looks as if Local System does not have access to SQL Server, ...
    (microsoft.public.dotnet.general)
  • Re: Debug stored procedures with VB6
    ... I can't see in the sql server analyser a tool to debug a stored procedure. ... VB6 English and MSDE English ...
    (microsoft.public.vb.database.ado)
  • Re: select message; not appearing
    ... messing up the debug visibility. ... I don't have any experience of the TRY-CATCH block messing up the output. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)