Delete statement in SQL is very slow

前端 未结 15 756
自闭症患者
自闭症患者 2020-12-22 23:23

I have statements like this that are timing out:

DELETE FROM [table] WHERE [COL] IN ( \'1\', \'2\', \'6\', \'12\', \'24\', \'7\', \'3\', \'5\')
15条回答
  •  忘掉有多难
    2020-12-23 00:02

    open CMD and run this commands

    NET STOP MSSQLSERVER
    NET START MSSQLSERVER
    

    this will restart the SQL Server instance. try to run again after your delete command

    I have this command in a batch script and run it from time to time if I'm encountering problems like this. A normal PC restart will not be the same so restarting the instance is the most effective way if you are encountering some issues with your sql server.

提交回复
热议问题