Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 save word document content to image data type

Author  Topic 

dev45
Yak Posting Veteran

54 Posts

Posted - 2004-09-21 : 08:46:44
hello all,
i have a word document. I am copying all its content to the clipboard .
In the db , there is a table with a image column and i am trying to save the contents of the clipboard into that column.
I have tryed something like :

EXEC sp_dboption 'databaseName', 'select into/bulkcopy', 'true'
GO
DECLARE @ptrval binary(16)
SELECT @ptrval = TEXTPTR(imageColumn)
FROM tableName
Where [id] =1

WRITETEXT tableName.imageColumn @ptrval actualData
GO

EXEC sp_dboption 'databaseName', 'select into/bulkcopy', 'false'
GO

this saves the data in binary format, but the i can't read them !
i am using

DECLARE @textpointer varbinary(16)
SELECT @textpointer = TEXTPTR(imageColumn)
FROM tableName where [id]=1
READTEXT tableName .imageColumn @textpointer 1 50

but this returns the binary encoding of the data. :(
any ideas on what to do next?


ps: i don't want to save the word document file to the db, just the contents of the word document
   

- Advertisement -