Results 1 to 3 of 3

Thread: Ways to bring data from SQL server but need input parameters for SQL to read

  1. #1
    Acolyte albertan's Avatar
    Join Date
    Nov 2017
    Location
    Canada
    Posts
    24
    Articles
    0
    Excel Version
    2013

    Ways to bring data from SQL server but need input parameters for SQL to read



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I was wondering if someone can please help me on best way to use parametirized SQL query and bring it to Power Query. I have access to SQL server with known connection string. SQL is long and needs to use specific input parameters (project numbers) in it. I don't want to have them changed each time in source so I am looking for ways to use parameters to modify the data. I may have up to 20 projects I need to change.

    In "Get Data" there are few ways to do it: Microsoft Query, SQL Server database, OLEDB. But I need to specify project numbers in SQL.

    What I thought might help is to use Microsoft Query and then use parameters there.
    I am trying to use VBA like in this video https://www.youtube.com/watch?v=HE9CIbetNnI however I'm not sure I can use variable or parameter in VBA code where SQL can refer to range and read the SQL

    Any help would be great.

    https://www.mrexcel.com/forum/excel-...-sql-read.html
    Last edited by AliGW; 2019-10-31 at 10:16 AM. Reason: Cross-post link moved from later post.

  2. #2
    Administrator AliGW's Avatar
    Join Date
    Nov 2015
    Location
    Ipswich, Suffolk, England
    Posts
    1,285
    Articles
    0
    Excel Version
    Office 365 Subscription
    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    Ali
    Enthusiastic self-taught user of MS Excel!

  3. #3
    Administrator AliGW's Avatar
    Join Date
    Nov 2015
    Location
    Ipswich, Suffolk, England
    Posts
    1,285
    Articles
    0
    Excel Version
    Office 365 Subscription
    They are different forums. Thanks for the link.
    Ali
    Enthusiastic self-taught user of MS Excel!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •