all groups > sql server mseq > june 2004 >
You're in the

sql server mseq

group:

BLOB


BLOB John A. Curry
6/29/2004 3:51:44 PM
sql server mseq:
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

Re: BLOB John A. Curry
6/29/2004 5:52:30 PM
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




[quoted text, click to view]

Re: BLOB HelloWebWorld
8/6/2004 1:56:52 PM

Hi John:
Can you please tel me how I can store documents like word and Excel t
the SQL Server Database? If you can email me at doctor27_in@yahoo.com
I would highly appriciate it.
Thanks,
Nikunj

[quoted text, click to view]


-
HelloWebWorl
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message815747.htm
AddThis Social Bookmark Button