Learning Curve
Learning Curve

Reputation: 1569

How to save OpenXML Word.docx in SQL for free text search (C#)

Could please anyone help me to save my Word.docx (OpenXML) document in SQL Server (C#). In my scenario I have to do the free text search on that document in SQL. I have made my sql table indexable but dont know how to insert that OpenXML document in that table.

Upvotes: 1

Views: 545

Answers (1)

Learning Curve
Learning Curve

Reputation: 1569

I have got it working guys. For those who are going through a similar situation, Get all bytes from FileStream and save it to the varbinary type column in your DB (SQL Server). To do the Free text search you need to make your table Indexable. There is alot of stuff availbe online or just google SQL "free text search". Remember if you are using SQL 2008, you will need to install "Filter Pack" for your SQL Management Studio as by default SQL 2008 dont have .docx etc. extension in it. It can be downloaded from the following link. Just follow the instructions for Filter Pack Installation http://support.microsoft.com/kb/945934

After installing Filter pack if you run "select * from sys.fulltext_document_types" will return you all the available filters. From here you can confirm your desired filter extension is supported by your Management Studio. Now you can write your free text search queries. Regards!

Upvotes: 1

Related Questions