Add column on table cause blocking

Mario2286 441 Reputation points
2020-08-19T06:21:43.707+00:00

I was adding column on one of my user table and found out that my alter table query blocked another query which i have no idea where does it come from .

ALTER TABLE [dbo].[table] ADD [column] [int] NOT NULL DEFAULT 0

My Add column SPID

and this is the query which has been blocked by my add column spid as below
18669-image.png

and this is the wait resource key

18610-image.png

This is object ID for index 281474978938880
18657-image.png

I believe a system query blocked by my add column query. Does anyone have idea what is that system query and why it is blocked when i m adding column on database which currently used by me only.

SQL Server | Other
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. Mario2286 441 Reputation points
    2020-08-20T09:20:00.397+00:00

    Does anyone have idea What query is this ?

    SELECT tr.name AS [Name], tr.object_id AS [ID], CAST( tr.is_ms_shipped AS bit) AS [IsSystemObject], CASE WHEN tr.type = N'TR' THEN 1 WHEN tr.type = N'TA' THEN 2 ELSE 1 END AS [ImplementationType], CAST(CASE WHEN ISNULL(smtr.definition, ssmtr.definition) IS NULL THEN 1 ELSE 0 END AS bit) AS [IsEncrypted] FROM sys.triggers AS tr LEFT OUTER JOIN sys.sql_modules AS smtr ON smtr.object_id = tr.object_id LEFT OUTER JOIN sys.system_sql_modules AS ssmtr ON ssmtr.object_id = tr.object_id WHERE (tr.parent_class = 0) ORDER BY [Name] ASC


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.