crystalreporting
Instructor
I have a series of folders containing PDF documents that I want to insert into a SQL table. I can get this to work for a single fixed document, but I am having trouble making the file path and file name dynamic. Here's what I have that works;
The PDF files are stored in a separate folder for each customer, with the invoice number being the actual filename e.g invoice number 123 for customer AB1000 would be C:\AB1000\123.pdf. I'd like to replace the 'C:\50.pdf' in the BULK statement with the customer number and invoice number from the Invoice_Table table.
Thanks in advance...
Peter Shirley
Macola Consultant, PA and surrounding states.
Code:
insert into Image_Table (
Customer,
Invoice_Number,
Document
)
select
Invoice_Table.Customer as Customer,
Invoice_Table.Invoice_Number as Invoice_Number,
(SELECT * FROM OPENROWSET(BULK N'C:\50.pdf', SINGLE_BLOB) as Document)
from
Invoice_Table
The PDF files are stored in a separate folder for each customer, with the invoice number being the actual filename e.g invoice number 123 for customer AB1000 would be C:\AB1000\123.pdf. I'd like to replace the 'C:\50.pdf' in the BULK statement with the customer number and invoice number from the Invoice_Table table.
Thanks in advance...
Peter Shirley
Macola Consultant, PA and surrounding states.