-1

I have table called "emp_manager" in employees database in SQL. It has 300153 rows. I want to delete entire table in SQL. I used drop table emp_manager; but, it is taking time and server does not respond it.

Can anyone help me to delete this table ?

enter image description here

2
  • Truncate is also taking too much time and sql workbench is getting hang. Is there any other way around to delete table with 300000 rows ? Commented Jul 3, 2022 at 12:20
  • 1
    300 thousand rows isn't that much, so if it it takes soe much time is there much traffic n the server?
    – nbk
    Commented Jul 3, 2022 at 12:27

2 Answers 2

0

You can use truncate table emp_manager

3
  • Truncate is also taking too much time and sql workbench is getting hang. Is there any other way around to delete table with 300000 rows ? Commented Jul 3, 2022 at 12:21
  • Maybe delete rows in batches by using where clause
    – mario19088
    Commented Jul 3, 2022 at 12:23
  • Maybe this would be helpful : stackoverflow.com/a/24213640/11278043
    – khalid btb
    Commented Jul 3, 2022 at 12:25
0

Maybe first delete the rows from that table by using Truncate command and then drop this empty table with drop table.

1
  • Truncate is also taking too much time and sql workbench is getting hang. Is there any other way around to delete table with 300000 rows ? Commented Jul 3, 2022 at 12:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.