locked
Security problem RRS feed

  • Question

  • Hello,

    The following query fails through Power Query because I do not have access to all the DBs.  I want the query to add new DBs on the fly, so no maintenance is required.  Can anyone help?

    = Sql.Database("PDX0SQL12", "SNA", 
    [Query="sp_MSForEachDB @command1='USE ?; 
    SELECT DISTINCT *
    FROM INFORMATION_SCHEMA.COLUMNS'"])

    I also tried this:

    let
        Source = Sql.Databases("PDX0SQL12"),
        #"Added Custom" = Table.AddColumn(Source, "Custom", each try Sql.Database("PDX0SQL12",[Name]) otherwise null)
    in
        #"Added Custom"

    Tuesday, July 18, 2017 5:46 PM

Answers