Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to delete rows #261

Open
hangsunmsft opened this issue Jun 25, 2024 · 1 comment
Open

Unable to delete rows #261

hangsunmsft opened this issue Jun 25, 2024 · 1 comment

Comments

@hangsunmsft
Copy link

Hi team, could you please kindly elaborate if it is possible to delete rows by using sql-spark-connector.

I tried to run a delete query but got the below error:
com.microsoft.sqlserver.jdbc.SQLServerException: A nested INSERT, UPDATE, DELETE, or MERGE statement must have an OUTPUT clause.

Then I added the OUTPUT clause, but got a different error:
com.microsoft.sqlserver.jdbc.SQLServerException: A nested INSERT, UPDATE, DELETE, or MERGE statement is not allowed in a SELECT statement that is not the immediate source of rows for an INSERT statement.

It seems like there is a limitation when users trying to delete rows.

The overwrite mode seems to be a workaround, but actually not efficient, especially when interacting with large data size.

@hangsunmsft
Copy link
Author

Screenshot 2024-06-25 153022
Screenshot 2024-06-25 153117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant