Thursday, December 7, 2023

SQL Server SSMS stuck on query while truncate the table

 I was going to truncate a table in sqlserver database but it seems to be went in deadlock. Apart from this if issue persist regularly then use delete command instead of truncate command.

List of Deadlock
SELECT
    SESSION_ID
FROM SYS.DM_EXEC_REQUESTS
WHERE BLOCKING_SESSION_ID != 0


Kill the deadlock:
kill SESSION_ID

No comments:

Post a Comment

web stats