In one transaction I am creating a table which references another table. In a second transaction, I run a SELECT-query against the referenced table but it is blocked by the first transaction. Why is that?
Transaction A:
BEGIN TRAN
CREATE TABLE Child (id int NOT NULL,
parentId int NOT NULL REFERENCES Parent (id));
Transaction B:
BEGIN TRAN
SELECT * FROM Parent; -- This query is blocked