Reputation: 1735
Is it possible to write data back to sql server source without using power apps in power BI?
If yes how
Thanks
Upvotes: 2
Views: 2033
Reputation: 4346
Yes, it is possible.
Let's suppose you have a MS SQL server named myserver
, DB called newtest
and a sql table called Table_1
. Table_1
consists of one column called Email
.
You intend to write a query that generates an email in power bi and you desire to write back that value in the table.
This is how you do it
let
Source = Sql.Database("myserver", "newtest"),
emailVal = "2@xyz.com",
Custom1 = "INSERT INTO [newtest].[dbo].[Table_1] (Email) VALUES('" & emailVal & "')",
Custom2 = Value.NativeQuery(Source, Custom1)
in
Custom2
Upvotes: 3