question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Force Truncate Table

See original GitHub issue

Problem I’m always frustrated when “Truncate table” doesn’t truncate my table when there are constraints.

Preferred solution I’d like to have a “Force truncate table” option, which automatically disables foreign_key_checks before executing.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kseniiaguzeevacommented, Aug 3, 2020

The function succesfully works in MySQL, MariaDB. But is it possible to fix Truncate tool Window blinking, when open it? See gif ckUvkNYmoU

0reactions
kseniiaguzeevacommented, Aug 5, 2020

verified

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to truncate a foreign key constrained table?
Run ALTER TABLE <Table Name> DROP FOREIGN KEY <Foreign Key Name> . This will remove the foreign key constraint. Drop the associated Index...
Read more >
13.1.37 TRUNCATE TABLE Statement
TRUNCATE TABLE empties a table completely. It requires the DROP privilege. Logically, TRUNCATE TABLE is similar to a DELETE statement that deletes all...
Read more >
Truncate tables with dependent foreign key constraints
You cannot truncate a table that has foreign key constraints. I would script your truncate statement to drop the constraints, then truncate ......
Read more >
Error Cannot truncate a table referenced in a foreign key ...
You cannot TRUNCATE a table that has FK constraints applied on it (TRUNCATE is not the same as DELETE). To work around this,...
Read more >
TRUNCATE TABLE (Transact-SQL) - Microsoft Learn
Removes all rows from a table or specified partitions of a table, without logging the individual row deletions. TRUNCATE TABLE is similar to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found