Edit SQL in Power Query

When I import data from Sql Server into Power Query, I can insert a query that will be executed in the database. But later, when I want to edit this query in Workbook Queries> Edit> Advanced Editor, I get something like this:

let Source = Sql.Database("server", "database", [Query="select#(lf)#(tab)*#(lf)from dbo.SomeView va#(lf)join dbo.SomeTable rm#(lf)#(tab)on rm.CatId=va.CatId#(lf)where 1=1#(lf)#(tab)and Month between 1501 and 1510#(lf)#(tab)and rm.Id in (1,2,3)"]) in Source 

Note that I'm using * , but with explicit column names this would look even worse.

I would like to see the query in a readable form, then copy it, execute it in Management Studio, change something and paste it back into Power Query. I know that I can use representations as a source or not use new lines and indents, but this is not my point.

Any ideas on how to edit SQL in a "normal" form? Or maybe I'm missing a hidden option.

EDIT: If I'm not the only person in the world having trouble finding this option, he:

Power Query> Launch Editor> View> Query Settings> Applied Steps> Source> Transfer Icon

Thanks Alejandro!

+5
source share
1 answer

If you click on the gear icon next to the source in the Query Parameters panel, you will get a dialog with the SQL query in readable form.

+7
source

Source: https://habr.com/ru/post/1235801/


All Articles