基本上我只想在表B中的列为NULL时允许表A中的编辑/更新。表A和表B引用相同的主键ID。所以像是;基于两个表关系的约束?
-- Only allow Table A to be updated when Table B column is NULL
update TableA
set blah = @a, foo = @b
from tablea
inner join tableb on tablea.id = tableb.id
where tableb.column is null
是否有某种方法可以将此用作表A的约束条件?
您可以使用触发器。你的意思是'tableb.column是空'? –