Results 1 to 6 of 6
  1. #1
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    565

    Importing PowerQuery results to SQL Server

    I have a PowerQuery in Excel that basically reads and cleans up a PDF of what looks like a Reporting Services report which contains a table. My PowerQuery sorts all that mess out and changes all the data types. So, in theory, I should be able to import that into SQL Server pretty easily.



    The PowerQuery source in SSIS is complete crap. Just flat out doesn't work at all, so I can't just move the PowerQuery to SSIS and then append that way.

    Is there any way to keep the data types in PowerQuery when importing to SQL Server? (Can I do that with BULK INSERT and a format file so that the data types are cast before the insert occurs?)

    IS there any other way of doing this with a local SQL Server (not Azure)... I know Azure can create a pipeline to do the transforms and then dump the result into a database... Kinda like should have been done in PQ on the desktop, but then MSFT couldn't charge for it. =(

    Thanks!

  2. #2
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,180
    If you have the results in Excel, why not use SSIS to import the Excel sheet?

  3. #3
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    565
    Because I was hoping I could loop over a collection of PDF files, which is where the data is coming from. Instead I have to use Excel to get all the PDFs from a folder, parse and import that, and then use SSIS to import from Excel. Because the PowerQuery source doesn't really work in SSIS. (Makes me wonder if that was on purpose!)

    SSIS blows. I guess that's MSFT's way to force people to pay for Azure? Sheesh.

  4. #4
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,180
    Haven't used it myself, but you could try R to import the files: https://www.mssqltips.com/sqlservert...to-sql-server/

  5. #5
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    565
    Quote Originally Posted by NoellaG View Post
    Haven't used it myself, but you could try R to import the files: https://www.mssqltips.com/sqlservert...to-sql-server/
    Or I guess I could create linked tables in Access and use that to do the insert... and use DIR() to loop over a set of files...

  6. #6
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    565
    Silly me! In PowerBI, make sure you have some external tools installed. I have DAX Studio 3.0.11 installed as an add-in. So it can see my model. From there I can go to External Tools > DAX Studio > Advanced Tab > Export Data > SQL Tables... specify database etc and you can export all the data to SQL Server.

    So be sensible and get all the data into your model and stuff it into SQL Server from there. Let the tools do all the dirty work.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 11-27-2023, 03:46 AM
  2. Replies: 3
    Last Post: 09-30-2021, 11:53 AM
  3. Read a sql server database outside of SQL Server
    By RayMilhon in forum SQL Server
    Replies: 6
    Last Post: 01-28-2020, 03:56 PM
  4. Upgrade from SQL Server 2008 to SQL Server 2014
    By RayMilhon in forum SQL Server
    Replies: 4
    Last Post: 07-12-2017, 04:54 PM
  5. Replies: 0
    Last Post: 12-20-2012, 01:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums