Hi
The formatting of your word document is embeded in the document itself,
therefore if you just store the text you will loose this. If you do not
translate this in the front end it will appear as binary. Alternatively you
could convert the documents before inserting the data (to say RTF) and use
ntext or provide a link to the file in the database.
John
[quoted text, click to view] "juststarter" wrote:
> hi,
> i have a word document. .
> 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 tried 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. :(
> 1. any ideas on what to do next?
> 2. does the image column preserve the original data format ? (ie: bullets,
> bold font, talbes etc)
> 3. should i use another data type ? (ntext maybe?)
> thx :)
>
> ps: i don't want to save the word document file to the db, just the contents
thx for your help john..
i still have a prob showing the results in the word doc (back from the db)
but i suppose this is another's newsgroup area !
[quoted text, click to view] "John Bell" wrote:
> Hi
>
> The formatting of your word document is embeded in the document itself,
> therefore if you just store the text you will loose this. If you do not
> translate this in the front end it will appear as binary. Alternatively you
> could convert the documents before inserting the data (to say RTF) and use
> ntext or provide a link to the file in the database.
>
>
> John
>
>
> "juststarter" wrote:
>
> > hi,
> > i have a word document. .
> > 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 tried 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. :(
> > 1. any ideas on what to do next?
> > 2. does the image column preserve the original data format ? (ie: bullets,
> > bold font, talbes etc)
> > 3. should i use another data type ? (ntext maybe?)
> > thx :)
> >
> > ps: i don't want to save the word document file to the db, just the contents
Hi
As I said.. it is a binary format and you will not be able to read it
with the tools available with SQL Server.
John
[quoted text, click to view] "juststarter" <juststarter@discussions.microsoft.com> wrote in message news:<8F5B1AD3-C474-4AD0-B827-DF403577FFFE@microsoft.com>...
> thx for your help john..
> i still have a prob showing the results in the word doc (back from the db)
> but i suppose this is another's newsgroup area !
>
>
> "John Bell" wrote:
>
> > Hi
> >
> > The formatting of your word document is embeded in the document itself,
> > therefore if you just store the text you will loose this. If you do not
> > translate this in the front end it will appear as binary. Alternatively you
> > could convert the documents before inserting the data (to say RTF) and use
> > ntext or provide a link to the file in the database.
> >
> >
> > John
> >
> >
> > "juststarter" wrote:
> >
> > > hi,
> > > i have a word document. .
> > > 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 tried 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. :(
> > > 1. any ideas on what to do next?
> > > 2. does the image column preserve the original data format ? (ie: bullets,
> > > bold font, talbes etc)
> > > 3. should i use another data type ? (ntext maybe?)
> > > thx :)
> > >
> > > ps: i don't want to save the word document file to the db, just the contents
Don't see what you're looking for? Try a search.