Solved

Import pdf files into SQL server database

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

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.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

770 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