October 23, 2019 at 11:52 am
How to load/import a pdf file into azure dB table as base64 column. Is there an direct SQL method/alternative to .net way.
October 23, 2019 at 4:04 pm
By 'base64' column you must mean varbinary(max)? I've never done it with a pdf file before but if it is possible in t-Sql then OPENROWSET would be my guess as to how:
https://docs.microsoft.com/en-us/sql/t-sql/functions/openrowset-transact-sql?view=sql-server-ver15
There are a few gotcha's (read the whole docs) if the files are large-ish. Are you sure you want to store files in the db? I never do it. I rename the file with a guid and insert the guid into Sql Server as a uniqueidentifier column.
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
October 23, 2019 at 5:20 pm
we store files in our databases and varbinary(max)
you would be adding an extra step to convert varbinary to base64/varchar(max). then if you need the file, you have to double convert it again from base64 to varbianry, and then varbinary to a file.
Are you sure that's what you want? why not just store the varbinary?
Lowell
October 26, 2019 at 6:07 am
I have to store the PDF in azure DB, which will be extracted from .NET code as pdf again. Going with the Azure blob approach is an overhead for me, since I have to finally store the PDF in Azure table. I am thinking of Varchar(max) to store. But, wondering if there is a direct way in SQL itself (either through, say, query, powershell, json SQL), it would be good.
October 30, 2019 at 10:53 am
Anyone ..any idea?
October 30, 2019 at 6:04 pm
Did you try openrowset?
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy