Solved

Import pdf files into SQL server database

Posted on 2014-02-24
3
3,093 Views
Last Modified: 2016-02-10
I am very new at SQL server and I have been tasked with managing a SQL SERVER 2008. I need to be able to import a pdf file which has the indexing values in the name of the pdf file.

Ex.  accounts.administrative. account number.date open.pdf

Each name before the period would be an index value or column name. Is there a way to automatically read from a file on a windows directory and populate the proper columns in SQL so that the document can be searched using SentryFile.
0
Comment
Question by:samiam41
3 Comments
 
LVL 34

Expert Comment

by:Brian Crowe
ID: 39882903
I think you would be best served by creating an SSIS package to scan the target directory and input the tokenized values in your database.  T-SQL isn't great at working with the file system but SSIS will allow you to utilize C# or other scripting code to cycle through and manipulate the files.

Below is a blog post that does something similar that might get you on the right path:

http://agilebi.com/jwelch/2008/02/02/importing-files-using-ssis/
0
 
LVL 9

Author Comment

by:samiam41
ID: 39926925
Will review and respond ASAP.  Thanks.
0
 
LVL 14

Accepted Solution

by:
Vikas Garg earned 500 total points
ID: 40031325
Hi,
You can also try following steps ...

>>  Open the PDF file in Acrobat Reader
>>  Click on Save As…
>>  Save the document as Text (Accessible) .txt (Flat File)
>>  Write a SSIS package importing data from Flat File to SQL server destination.


Below is the link to fetch data from flat file to SQL in ssis package

http://www.mssqltips.com/sqlservertip/2923/configure-the-flat-file-source-in-sql-server-integration-services-2012-to-read-csv-files/

OR

You can use MS sql Import export wizard to import the Text file data to SQL

http://technet.microsoft.com/en-us/library/ms141209.aspx
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My client sends a request to me that they want me to load data, which will be returned by Web Service APIs, and do some transformation before importing to database. In this article, I will provide an approach to load data with Web Service Task and X…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now