Forum Discussion
Accessing SQL Blobs
- 6 years ago
Yes, Power Query has a "Binary" data type that you can then bend to your will, for example by declaring that you want to read that binary as a PDF.
Just add the blob to your SQL view columns.
Here's an example where I pull a bunch of CSV files out of their blobs (the [Content] column)
#"Invoke Custom Function1" = Table.AddColumn(#"Renamed Columns1", "CSV", each #"Get CSV file"([Content])),
via a custom function where I do some basic transforms:
Get CSV File =
(File) => let
Source = Csv.Document(File,[Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.Csv]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),....
- Anonymous6 years ago
Thank you. I apologize, for getting upset.
How can that, at least, be done? I cannot find any good and clear instructions on doing so.
Extracting data from PDF files that are stored as blobs - that can be done, and that is what I was referring to. You did not mention that you want to display the PDF files in Power BI.
Thank you. I apologize, for getting upset.
How can that, at least, be done? I cannot find any good and clear instructions on doing so.
- lbendlin6 years agoSuper User
Here is an example with XML, the process is similar with PDF
let Source = Sql.Database("server", "database"), Reports = Source{[Schema="schema",Item="table"]}[Data], #"1" = Reports{[id_report=1]}, Meta = #"1"[Meta], #"Parsed XML" = Xml.Tables(Meta),This connects to a SQL server database, fetches the first row of a table, then fetches the blob from the [Meta] column and then parses the data in the blob as XML.
From there on you can traverse the XML structure and extract the data, much in the same way as you would open the PDF blob and then extract the data from there. The only difference will be that you use Pdf.Tables from binary.
- Anonymous6 years agoNot applicable
Again, I don;t understand any of that. Woudl you please supply instructions?
- Anonymous6 years agoNot applicable
Thank you, for all of your help, lbendlin! The demo went fine! You're great, and I really appreciate all that you do!
John