BookmarkSubscribeRSS Feed
heffo
Pyrite | Level 9

Hi,

I have an SQL server that has documents (Word, Excel etc) that are saved as blobs. I now want to convert the data as text (to be used in Visual Text Analytics). I have tried a couple of version but nothing works. Any ideas on how to do this? At the moment I'm using SAS Studio to do this.

Cheers,

Henrik 

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

> I now want to convert the data as text

So you want to extract text from MS office files currently stored as blobs?

heffo
Pyrite | Level 9
That is correct. Get the text from the word documents (and possibly email messages) to be used as text for Text Analytics.
ChrisNZ
Tourmaline | Level 20

There may be better ways, but now that DDE has been killed by MS, I would probably:

1. Extract the MS SQL data and save it as a binary file. If the files are larger then 32k, you'll need to use explicit SQL pass-through so the data is passed in 32k chunks.

2. Run a vbs script to dump the contents into a txt file.

3. Read that txt file into SAS

 

SASKiwi
PROC Star

You'll need to do that in SQL Server as part of an SQL passthru query. Googling SQL Server blob to string found this example: https://dba.stackexchange.com/questions/240441/sql-server-convert-blob-data-to-string

amongst many others.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1559 views
  • 0 likes
  • 3 in conversation