Chris Webb beschreibt in diesem Beitrag, dass es mit Power Query theoretisch möglich ist, Daten im SQL-Server Backend zu aktualisieren. Ist sicher nicht gerade das, was sich die meisten DBA’s wünschen…
As of the November update of Power Query, it’s now possible to write your own SQL query when you’re moving data out of SQL Server into Excel using Power Query. So I got thinking… if you can write your own SQL query, can you execute any other SQL statement? Can you use Power Query to move data out of Excel and into SQL Server? Well, it turns out you can… with some limitations. This blog post details what I found out while researching this problem.
I started with a simple table in a SQL Server database with two columns, Fruit and Sales, and some data:
I then created a new function in Power Query with the following definition:
let
UpdateFunction = (Fruit, Sales) =>
Sql.Database(
"MySQLServerInstance",
"PowerQueryTest",
[Query="UPDATE [FruitSales] SET [Sales]=" & Number.ToText(Sales)
& " WHERE Fruit='" & Fruit & "'"])
in
UpdateFunction
Ursprünglichen Post anzeigen 255 weitere Wörter
Kommentar verfassen