0

my requirement like this.

i have word document with the format like data is:

> 1. this is test doc.
>  1.1 this is test doc1.1
>    1.1.1 this is test doc 1.1.1
>  1.2 this is test doc 1.2
>   1.2.1 this is test doc 1.2.1

now , i want read the document data and store in my sql. my table look like this:

    > ID     requirement               parentid
    > 
    > 1      this is test doc          0 
      2      this is test doc1.1       1 
      3      this is test doc 1.1.1    2 
      4      this is test doc 1.2      1
      5      this is test doc 1.2.1    4

so, is it possible to read the data from doc and save in sql server.

Suresh Chaudhary
  • 1,609
  • 5
  • 25
  • 40

1 Answers1

0

In SQL Server 2008, We have hierarchyid datatype. Please find the below link describing the new datatype and its uses.

I think that will make the implementation of the solution a lot easier. As I can relate to a hierarchy when a word document has sections- sub sections- sub sub sections like ( 1, 1.1, 1.1.1 etc).

Links are: http://msdn.microsoft.com/en-us/library/bb677290.aspx

http://msdn.microsoft.com/en-us/magazine/cc794278.aspx

http://www.sqlservercentral.com/articles/SQL+Server+2008/62204/

Hope this helps.

Nisha_Roy
  • 424
  • 2
  • 9
  • 15
  • but how can i read data from word file. this is not mentioned in any links. – Suresh Chaudhary May 24 '11 at 12:11
  • @Suresh: Your DB structure will change to an extent if you go for Hierarchy Id in because i dont think you will need the parent Id column. Next thing is how to read the document. You can try using the Interop.Office dlls in .net Framework. Find the part of the solution in the sample links below: [link](http://stackoverflow.com/questions/2749344/how-to-use-interop-for-reading-word-document-and-get-page-number). But you will have to devise your own parsing logic . – Nisha_Roy May 25 '11 at 03:32