Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Delete Datas of SQL

(0) ShareShare
ReportReport
Posted on by

Good morning,

 

How can i erase a data of SQL DataBase?

 

 

  • v-xida-msft Profile Picture
    v-xida-msft on at
    Re: Delete Datas of SQL

    Hi @Anonymous ,

    Have you defined a proper PRIMARY KEY within your SQL Table?

    Further, have you made your SQL Table as Read-Only within your SQL Database?

     

    I do not find any syntax error with the formula you typed in your app. Based on the error message "The data source is read only, ..." that you provided, it seems to tell that you have set your SQL Table as Read-Only within your SQL Database.

    Please check if you have set your SQL Table as Read-Only within your SQL Database. If true, please consider remove this limit from your SQL Database.

    Please check and see if the following blog would help in your scenario:

    https://www.techcartnow.com/change-database-from-read-only-to-read-write-mode-in-sql-server/

    https://stackoverflow.com/questions/2529839/how-to-make-a-table-read-only-in-sql-server

     

    Also please check if you have defined a proper PRIMARY KEY within your SQL Table. If you want to remove records from a SQL Table within your app using Remove() function, the PRIMARY KEY is required in your SQL Table.

    Please check the following SQL Server connector limits for more details:

    https://docs.microsoft.com/en-us/connectors/sql/#known-issues-and-limitations

     

    If the issue still exists, please consider re-create a new SQL Table along with a proper PRIMARY KEY in your SQL database, then re-create a new connection to this new Table from your app, try your Remove function again, check if the issue is solved.

    Note: Do not make your SQL Database as Read-Only.

     

    Best regards,

  • yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: Delete Datas of SQL

    Okay. Can you please check the SQL data table and confirm that it has atleast one primary key. This error usually pops up when the data table does not have a primary key. 

     

     

    Thanks. 

  • Re: Delete Datas of SQL

    The error says something like "The data source is read-only so it is not possible to write the remove function on it".

  • yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: Delete Datas of SQL

    Hi, 

     

    I do not understand the language. It would be really helpful if you could post the error in English. 

     

    However, I see a few errors in the expression. 

     

    In the Remove command, you have used a semicolon between the function and the input parameter so please make that as a comma. 

     

    After the remove part you have put two semicolons please remove one. I see that within the OnSelect command in the advanced editor, you have put semiclon in the IsEmpty function too. Please make necessary changes and ensure that the semi colons and commas are properly placed. 

     

    Hope this helped. 

     

    Thanks. 

  • Re: Delete Datas of SQL

    Follow the error

  • yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: Delete Datas of SQL

    Hi, I am unable to see the error in this one. Can you please share a screenshot clearly indiacting the error. 

     

    Kindly ensure that the SQL table has a primary key defined. 

     

     

    Thanks, 

  • Re: Delete Datas of SQL

    I have this error.

     

     

  • yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: Delete Datas of SQL

    Hey!

    Please refer to the screenshot below for the command to delete the selected item.MicrosoftTeams-image (4).png

     

    Hope this helps!

    Thanks,

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • Re: Delete Datas of SQL

    In reality i want to delete only the line selected in the database 

  • yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: Delete Datas of SQL

    Hey! If you want to remove all the data from the table, please refer to the screenshot and use the formula : 

     

    RemoveIf('[dbo].[employees]',true)

    here 'employees' is my table name. MicrosoftTeams-image.png

     

    Thanks, 

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard