Solved

Import pdf files into SQL server database

Posted on 2014-02-24
3
3,265 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 15

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Here's a requirements document template for an integration project (also known as Extract-Transform-Load or ETL) based on my development experience as an SQL Server Information Services (SSIS) developer over the years.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

839 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