Suppress Power Query's Native Database Query Warning

Is there a way to suppress the "Native Database Query" warning issued by Power Query when running a SQL query directly against a Teradata database?  This warning states, "You are about to run a native database query.  Native queries
can make changes to the database.  Would you like to run the following query?"

If we never prompted here, then I could send you a workbook with the embedded query "drop table foo". You'd open it, Power Query would run analysis and we'd execute the statement -- all before you had any idea what had happened. It's true that
there are many potential users for whom showing the SQL text isn't useful. Hopefully, those users don't have the kinds of server permission that would let a query run with their credentials do lasting damage. But the prompt is to deal with the very possible
risk of having even a sophisticated user run a query by accident that they shouldn't have.
The original intent of the feature was to support a scenario where a user says "I already have a SQL query whose output I want to consume into Power Query; why can't I just use that?" It did not take parameterization into account. We subsequently
considered adding parameterization to this method, but didn't feel that we could sufficiently guarantee security. That is, if your query text is Sql.Database("server", "database", [Query="exec @sql", Parameters=[sql="drop
table foo"]], the user would be prompted only with "exec @sql" and the malicious payload would be delivered invisibly.
We very much do not want to have the responsibility of parsing multiple different dialects of SQL to try to guess whether or not it contains potentially-malicious code.
Our current thinking on this is that we might let advanced users write "trusted code" which has to go through a separate verification step. Code of this type might be able to generate SQL statements without a user prompt. So a workbook might have
a dependency on the "My Trusted Code" module, and simply won't run if that module hasn't been installed on the local machine. The user would then need a trustworthy (but convenient) way to obtain that module from a trustworthy source.

Similar Messages

  • Trouble connecting to SQL 2014 Database using Power Query

    I am trying to connect to a SQL 2014 Database using Power Query.  My connection string requires that I set the "Application Intent" setting to a value of "readonly", The connection parameter is required by SQL 2014 because of
    the failover cluster configuration.   
    I have successfully been able to connect via PowerPivot with the following connection string:
    Provider=SQLNCLI11;Data Source=<Server>;Persist Security Info=False;Integrated Security=SSPI;Initial Catalog=<DB>;Application Intent=readonly
    I cannot seem to find the correct syntax to connect via SQL 2014.  This is the syntax that I have been attempting: 
    Sql.Database("<Server>", "<DB>",[Application Intent=readonly])
    Is this currently supported?
    Thanks, Barbara

    It's not yet, I'm afraid, but it's something we're aware of and have vague plans to address :/.

  • Power Query Update breaks connection to PostgreSQL database

    After the update to Power Query 2.11.3625.144, we can't connect our PostgreSQL database anymore. 
    Error message is: 
    DataSource.NotFound: PostgreSQL: Unable to find a database provider with invariant name 'Npgsql'.
    This error may have been the result of provider-specific client software being required but missing on this computer.  To download client software for this provider, visit the following site and choose at minimum 'Npgsql version 2.0.12': http://go.microsoft.com/fwlink/?LinkID=282716
    Readding the Npgsql driver doesn't solve the issue. Has the version requirement changed with the Power Query update? Or is PostgreSQL connectivity completely broken?

    Hmm, 
    If I add the line, I get the following error message in Power Query: 
    'Npgsql' returned the error: 'Unrecognized element. (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config line 169)'.
    This error may have been the result of provider-specific client software being required but missing on this computer.  To download client software for this provider, visit the following site and choose at minimum 'Npgsql version 2.0.12': http://go.microsoft.com/fwlink/?LinkID=282716
    The code in the machine config looks like this: 
      <system.data>
            <DbProviderFactories />
            <add description=".Net Framework Data Provider for Postgresql Server" type="Npgsql.NpgsqlFactory, Npgsql, Version=2.0.12.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" name="Npgsql Data Provider" invariant="Npgsql" support="FF"/>
        </system.data>
    The node seems to be empty by default. Can it be that the surrounding stuff has to be differently written in that case?

  • Power Query Cannot Connect to NAV Database

    I can access the NAV database and get data by PowerPivot, however when I connect to NAV database with Power Query and enter my user name and password.  Power Query will pops out error message "The User Was Not Authorized".  But my account
    works fine in powerPivot.  Can anyone provide me some help please?
    Thanks
    Henry

    In Power Query, there are usually different types of credentials that you can choose on the left side of the dialog. Are you sure you've chosen the right type of credentials (ie. SQL auth vs Windows auth)?

  • Running a SQL Stored Procedure from Power Query with Dynamic Parameters

    Hi,
    I want to execute a stored procedure from Power Query with dynamic parameters.
    In normal process, query will look like below in Power Query. Here the value 'Dileep' is passed as a parameter value to SP.
        Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData 'Dileep'"]
    Now I want to pass the value dynamically taking from excel sheet. I can get the required excel cell value in a variable but unable to pass it to query.
        Name_Parameter = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
        Name_Value = Name_Parameter{0}[Value],
    I have tried like below but it is not working.
    Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData Name_Value"]
    Can anyone please help me with this issue.
    Thanks
    Dileep

    Hi,
    I got it. Below is the correct syntax.
    Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData '" & Name_Value & "'"]
    Thanks
    Dileep

  • Using Power Query to import image files for Power View

    I am trying to use Power Query to import image data from a SQL Azure database for use in Power View.  I've selected both the source image table and the ?images table in the workbook query.  The files seem to load as binary data in the Power
    Query editor but when loaded to the data model with Power Pivot, the field becomes "text" type rather than binary.  Does anyone know the procedure to use  PowerQuery to load image files into PowerPivot?

    Hi,
    We currently do not support loading binary data from Power Query into the Power Pivot data model. This is something we'd like to address soon. For now, you will need to use the Power Pivot import capabilities if you want to achieve this.
    Sorry about the inconvenience - we will try to enable this feature over the coming months.
    Faisal Mohamood | Program Manager | Data Platform Group - Microsoft

  • Using an existing connection in the Excel 2013 file in Power Query

    Hi,
    I've created an Excel workbook and a SQL Server data connection in this workbook.
    When I open Power Query I cannot to use this created data connection.
    In general, inside Power Query can I use a data connection created in the original Excel workbook?
    Many thanks

    Following on from Ehren's advice please find the following screen shot and link; -
    https://support.office.com/en-gb/article/Connect-to-a-SQL-Server-database-Power-Query-e5004318-0f2e-46a3-8b15-1559aa3c04db?ui=en-US&rs=en-GB&ad=GB
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

  • Power Query for Excel - Need Help with Oracle SQL Syntax

    Hello everyone,
    I am new to Power Query and am not able to figure this out.  I am trying to pull in data into my Excel spreadsheet using a specific Oracle SQL query.  While in query editor, how do I take the Oracle.Database function and add my SQL statement? 
    I already know what I want, I don't want it to download all the table names.  According to the help page, I should be able to do this but it does not provide a syntax example
    Also, I don't understand what "optional options as nullable record" means.
    Below is what function and arguments the help page notes.  How do I use this?
    Oracle.Database(server as text, optional options as nullable record) as table
    Any help is greatly appreciated.
    Thank you,
    Jessica

    When I try this, I get an error 
    DataSource.Error: Oracle: Sql.Database does not support the query option 'Query' with value '"Select * from Owner.View_Name"'. Details: null
    I'm trying to download oracle data from a view into power query - Power Query navigator does not list th eviews from my source, it lists only the tables. When I try write sql statements, it throws me the above
    error. This is what I tried
     Oracle.Database("Source/Service",[Query="Select * from Owner.View_Name"])
    Any ideas how to fix this? 

  • Automatic Refresh of a Merged Power Query giving 'Table Not Registered' error

    Scenario: I have 5 tables in my Azure VM SQL database associated with my ERP system. I have loaded all 5 tables into a 'Build Excel' workbook, merged the tables together and created a dataset that my users will be using.  From that 'Build
    Excel' workbook - I published to the BI catalog a data set simply called 'Customer information and Statistics' - This is searchable by my users and they don't have to go through the effort of combining the 5 tables.
    I have a published workbook that uses the 'Customer Information and Statistics' data set and nothing else.  I tried to schedule a refresh of the data and it failed (below is the error when I did a manual refresh):
    OnPremise error: Sorry, the data source for this data connection isn't registered for Power BI. Ask your Power BI admin to register the data source in the Power BI admin center. An error occurred while processing table 'Customer Information and Statistics'.
    The current operation was cancelled because another operation in the transaction failed.
    So, going down that rabbit hole, I began the process of 'registering' this in Power BI - however, when I copied in the connection string it began walking me through a process of providing credentials to the 5 tables in my SQL server - that are already exposed
    in my main data Sources.  I figured I would continue and tried to use the service account credentials that my main data sources use and it would not properly authenticate.
    Taking a step back it prompted a few questions:
    Why am I being asked to register these 5 merged data sources that are already exposed in my base data sources?
    Is my approach of creating 'Friendly named' Merged datasets for my users an incorrect approach?
    Is there a different method I should be using to establish autorefresh on Merged datasets in these published workbooks using Power Query?
    Thanks for the help -
    Tom Grounds

    Tom, can you submit this as a bug in the UI via the Smile Frown button?
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Can't Enable Power Query Add In

    I have the same issue as described by Bill on April 1, 2014.  
    I am using Win-7 Enterprise SP-1 64-bit; MS-Office Professional Plus 2010 ver: 14.0.7140.5000 (32-bit) and have been using Power Query (32-bit) Add-in on Excel for the past 12-18 months.  I have regularly been notified of available PQ upgrades and have
    installed them successfully.
    Yesterday, I opened Excel, but PQ was not enabled.  The Office Add-in manager shows that PQ is disabled.  I attempted to enable the COM Add-In but to no avail. The Add-In location folder for PQ shows (C:Windows\SysWOW64\mscorre.dll).  That
    folder and file is at that location.  Going through the enabling process produces no positive result and no warning message complaints.
    I visited MS Power Query download site, downloaded the latest PQ and ran the install.  I choose all the default responses during the install and got no warning messages.  I an still unable to enable PQ.
    Any help anyone may provide would be appreciated!

    If you go into the registry (through regedit), what is the value of LoadBehavior when you navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\Excel\Addins\Microsoft.Mashup.Client.Excel?
    Is it 0x00000003 (3)?

  • Power Query import data error

    Hi all,
    As Power Query does not support ODBC I tried direct connect to DB via menu
    From Database/From MySQL Database.
    I passed authorization and my query was being running. 
    But after all records were downloaded I just got error 
    'SELECT command denied to user '****'@'x.x.x.x' for table 'bogus_table' and 
    as result PQ query was failed.
    What's interesting is that my original query was 'SELECT id FROM b_user'. 
    I do NOT query any 'bogus_table'.
    What does all that mean?
    -- Paul

    This appears to be a bug in the MySQL ADO.NET driver. Under some circumstances, when you close the DbDataReader, the MySQL driver will attempt to run the query “SELECT * FROM bogus_table LIMIT 0”. It attempts to trap the error by checking for error number
    1146 (table not found), but in this case it’s getting a different exception – probably error number 1142 (select permission denied).
    You should
    1) Report the bug to MySQL.
    2) Delete the table named bogus_table, if it’s not actually needed.
    3) Consider renaming the table named bogus_table if it is needed, or granting select permission to all users.
    We're sorry you had to run into this, but even if we could mitigate this MySQL bug in Power Query code, it would take nearly two months for you to get the updated version. Fixing the local data is likely the best approach.

  • Power Query Cannot Access all the NAV Table

    When I connect to NAD Database via PowerPrivot, I can get all the NAV table it's around 1936 tables, however when I access via Power Query it will only able to access around 1100 tables. All the important tables are not showing at the workbook Queries. Can
    anyone help please?
    Henry

    Ok, I have some more info on this. We found this bug right near the time we GA'd but it was too late to take the fix. It will be available in our next release. I don't know if we've officially announced the date but you should have it within the next month
    or so.
    There should be two workarounds until you have the fix:
    As I mentioned in the last reply, when connecting to the SQL database, instead of just typing in a server name, you can also specify the database name directly.
    If you don't specify the database, when you're viewing the list of tables in the sidepane on the right side of Excel, select any of them and click Edit near the bottom (or double click on the table name.) This will open up the wrong table in the Query Editor.
    Then you can expand the database navigator on the left side of the Query Editor and you should see all the tables in that list.
    [Oops, I see that Peter and I replied at the same time! I'll leave my note here anyway.]

  • Power Query - Sybase iAnywhere Error

    Hi,
    When I try to connect using From Sybase Database I get the following error. I have the Sybase SQL Anywhere installed. (C:\ProgramData\SybaseIQ\Samples\SQLAnywhere) I have Windows 7 64 bit. Any direction as to why Power Query does not see SQL Anywhere?
    DataSource.NotFound: Sybase SQL Anywhere: Unable to find a database provider with invariant name 'iAnywhere.Data.SQLAnywhere'.
    This error may have been the result of provider-specific client software being required but missing on this computer.  To download client software for this provider, visit the following site and choose at minimum 'Sybase SQL Anywhere Client Software':
    http://go.microsoft.com/fwlink/?LinkId=324846
    Thanks
    Lauren

    Hi Lauren,
    When installing the Sybase, please make sure the Sybase ADO.NET provider is installed correctly.
    Regards
    Qunshu
    Clarification: Microsoft doesn't own any liability & responsibility for any of my posting.

  • What's Preventing Query Folding in this Power Query?

    I've watched the Power Query presentation at the 2014 Tech Ed, and I'm trying to understand why this PQ (below) doesn't employ query folding.  The Tech Ed Power Point presentation states suggests that "Internal Power Query logic" affects folding,
    but I'm unclear what that means.  Are the Text functions inhibiting query folding?  If so, how might I "scrub" arguments in a custom function parameter list while still encouraging query folding?
    let
    Source = Teradata.Database("fsltdprd.am.freescale.net"),
    Product = Source{[Schema="EDW",Item="PROD_PDM_EFF_CURR"]}[Data],
    Prodline = Source{[Schema="EDW",Item="PROD_LN_PDM_DOC"]}[Data],
    ProdFilter = Table.SelectRows(Product,
    each [MTRL_TYPE_CD] = Text.Upper(Text.Trim("AA"))
    and Date.From([REVSN_RLSE_DTTM]) >= #date(2014,1,1)),
    PrdlFilter = Table.SelectRows(Prodline,
    each [TM_VAR_STS_FLG] = "A"
    and [EFF_TO_DT] = #date(3999,12,31)
    and Text.StartsWith([PTI_CD],Text.Upper(Text.Trim("J")))),
    ProdCols = Table.SelectColumns(ProdFilter,
    {"PART_ID","MTRL_TYPE_CD","PLC_CD","PAO_CD","REVSN_RLSE_DTTM","PROD_LN_ID"}),
    PrdlCols = Table.SelectColumns(PrdlFilter, {"DOC_ID","PTI_CD","PKG_CD"}),
    Join1 = Table.Join(ProdCols, {"PROD_LN_ID"}, PrdlCols, {"DOC_ID"}, JoinKind.Inner),
    Results = Table.RemoveColumns(Join1, {"DOC_ID"})
    in
    Results

    Btw, this is the "finished" product ... 
    (optional #"Pti 1 thru 4" as text
    , optional #"Mtrl Type" as text
    , optional #"Last Revision Dttm" as datetime) =>
    let
    Source = Teradata.Database("fsltdprd.am.freescale.net"),
    MtrlType = Text.Upper(Text.Trim(#"Mtrl Type")),
    PtiCode = Text.Upper(Text.Trim(#"Pti 1 thru 4")),
    LRevDttm = #"Last Revision Dttm",
    Product = Source{[Schema="EDW",Item="PROD_PDM_EFF_CURR"]}[Data],
    Prodline = Source{[Schema="EDW",Item="PROD_LN_PDM_DOC"]}[Data],
    ProdFilter = Table.SelectRows(Product,
    each (if MtrlType = null then true else [MTRL_TYPE_CD] = MtrlType )
    and (if LRevDttm = null then true else [REVSN_RLSE_DTTM] >= LRevDttm )),
    PrdlFilter = Table.SelectRows(Prodline,
    each [TM_VAR_STS_FLG] = "A"
    and [EFF_TO_DT] = #date(3999,12,31)
    and (if PtiCode = null then true else Text.StartsWith([PTI_CD], PtiCode ))),
    ProdCols = Table.SelectColumns(ProdFilter,
    {"PART_ID","MTRL_TYPE_CD","PLC_CD","PAO_CD","REVSN_RLSE_DTTM","PROD_LN_ID"}),
    PrdlCols = Table.SelectColumns(PrdlFilter, {"DOC_ID","PTI_CD","PKG_CD"}),
    Join1 = Table.Join(ProdCols, {"PROD_LN_ID"}, PrdlCols, {"DOC_ID"}, JoinKind.Inner),
    Results = Table.RemoveColumns(Join1, {"DOC_ID"})
    in
    Results

  • Unable to setup Power Query automatic refresh in Power BI Sharepoint Portal as per instructions

    Followed all instructions to setup a PowerQuery connected data source for automated refresh but no luck. Keeps giving the following error message. A connection could not be made to the data source with the Name of 'TestConnection' when trying to test the
    connection.
    Here are the exhaustive steps.
    1. Created an excel file that uses power query to connect to an On Prem database
    2. Created a powerview against the resulting data set (stored in data model/powerpivot)
    3. Setup a data management gateway on O365 Power BI Admin center
    4. Installed Data Management Gateway and associated keys on the On Prem server (established connection handshake successfully)
    5. Created a data source in Power BI Admin center, specified Power Query as the data source, copied and pasted Power Query connection string from excel file, validated tested connection for data source
    6. Uploaded the report file to Power BI site
    7. Now, when trying to setup the automatic refresh, it pulls the information for the associated connections in the file correctly. However when trying to test the connection, constantly just returns with the following message
    A connection could not be made to the data source with the Name of 'TestConnection'. Correlation ID: c3d2a19b-f03d-4b14-8d5e-8fe0ed103238
    It looks like the DMG based update is still half baked. What is missing here since all of the data connection validation and handshake steps for gateway and data source works correctly. Why is it that the Powerquery based excel file is unable to leverage
    the DMG and datasource to connect and pull data?
    Any thoughts or guidance, much appreciated.

    Everything,
    Is this still an issue?
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

Maybe you are looking for