0
Is it possible to delete a row from a table with dependencies? I tried the command
ALTER TABLE MinhaTabela NOCHECK CONSTRAINT ALL
But the error appears
Error Code: 1064. You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for the right syntax to use near 'NOCHECK CONSTRAINT ALL
What’s wrong?
This syntax is SQL Server and not Mysql, ideally you identify the records that reference it and take this reference before deleting, otherwise your database will be full of inconsistencies
– Jeferson Almeida
Got it, thanks, but it’s possible to delete it anyway?
– Junior
Yes, but if you delete only by disabling Fk validation, your database will be inconsistent forever, until you fix this data and it will only generate problems in the future
– Jeferson Almeida
Okay, thanks, it’s more for learning effect
– Junior