How to add new row data to PowerBi table on refresh - sql

On our SQL Server, our org has a table that contains a current instance of records. I need to query that table and append the output row(s) to a PowerBi data table.
I have researched doing this in Power Automate with the “Add Rows to a dataset” step. Unfortunately, I cannot find a way to use the aforementioned SQL query as the payload.
Has anyone else encountered this use case? Is there an alternative way to continuously add rows to a table based on a SQL query?

I would start with this stock template:
https://powerautomate.microsoft.com/en-us/templates/details/ab50f2c1faa44e149265e45f72575a61/add-sql-server-table-rows-to-power-bi-data-set-on-a-recurring-basis/

There are few ways
Incremental refresh https://learn.microsoft.com/en-us/power-bi/connect-data/incremental-refresh-overview
Duplicate's remover, you download whole DB, and then remove dublicates
Crete SQL side VIEW which do same things, and in PBI side use this VIEW

Related

How can I get the modified table name(any table in db) and it's modified value without using triggers in SQL Server?

I am creating database snapshot for reporting(creating a common demoralized table from normalized tables), for which I need to enter normalized tables modified values at the same time when the table modify. I want a common solution for this. Same is achievable using triggers but I am looking for some other generic solution which will work with any table change. Is there any other way in SQL server by which I can achieve the same?

Best way for block SQL table records in SQL Server

I have SQL Table in SQL Server like this:
In this table there are old records (Last year).
I should use this table again.But old records to be blocked (No operation taken on them (Select,Update, Delete)).
I can't modify design table and add another field like locked or date or add new table for handle operations.
Is this possible in SQL Server?
It would be very helpful if someone could explain best solution for this problem.
Thanks.

Adding new data to the end of a table using power query

I've got my query that pulls data from sql server 2012 into excel using power query. However, when I change the date range in my query I'd like to pull the new data into my table and store it below the previously pulled data without deleting it. So far all I've found is the refresh button, which will rerun my query with the new dates but replace the old. Is there a way to accomplish this? I'm using it to build an automated QA testing program that will compare this period to last. Thank you.
This sounds like incremental load. If your table doesn't exceed 1,1 Mio rows, you can use the technique described here: http://www.thebiccountant.com/2016/02/09/how-to-create-a-load-history-or-load-log-in-power-query-or-power-bi/

SQL View displaying incorrect data while the same sql code run in a query window gives correct data

One of my SQL view when opened and run in a design window gives incorrect data while the same underlying SQL code is run in a new Query window gives correct data. To be more specific, this view is pointing to a table where data changes on a daily basis. Why am I getting stale data in the design view while the same (same view underlying sql) code run in a Query Window gives current data. This has never happened before. There is a excel sheet that connects to this view to pull data into reports and this is getting the stale data into the report.
What should I be looking at to fix this issue.
And the server is SQL Server 2008 R2 (SP1)
Any help is appreciated. Thanks in advance.
You probably use * in your view to select all columns from some table
select * from table
when you add a new column to that table you'll need to re-run the view, then it'll work... select *, especially in view is generally considered a bad practice. In the case of a * metadata is not automatically updated when the tables (or schema for that matter) used in view are modified, therefore you'll need to alter the view
another way of refreshing it is running system stored proc:
EXEC sp_RefreshView vw_ViewName

FORM on a SQL Query APEX

I am working in Oracle APEX 4.2. I have created Form on Table, Tabular Form and Form on Table with Report. I have tried a lot to create form on a SQL Query but i can't.
I have two Question related of Form on a SQL Query !
First i want to make Form on SQL Query on Two Tables i-e `
Patient_Registration
Pat_Id(Pk),Name,Address,Gender ,Age,Contact
and Patient_Charges
P_Ch_Id(Pk),Patient_Id(Fk),P_Doc_Charges,P_Extra_Charges
Second is that if the from is made then we will be able to make insertions on two tables in one form ?
I *think * I understand your question.
Create a view with your SQL query and then add a Before Insert trigger which does the necessary DML.
Check out some of the sample apps for ideas in this respect.