CREATE TRIGGER UpdateTable on User_Sample after update AS BEGIN declare @userType int --得到更改的字段值 set @userType='2' --得到表1和表2关联的id,也就是外键,table2的ID declare @userId int
set @userId = (select userId FROM User_Sample ) -- 更新表2 " update Users set Usertype=@userType where Users.userId =@userId END GO UPDATE [User_Sample] SET [state] = 'True' WHERE [id] = '2' ((select userId FROM User_Sample 获取的是多个值,求有办法至获取修改的那个字段的id莫?