Solved

Import pdf files into SQL server database

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

759 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

19 Experts available now in Live!

Get 1:1 Help Now