日期:2014-05-18 浏览次数:20504 次
Update Employee Set EmployeeNo=deleted.LoginName,EmployeeName=deleted.UserName,Password=deleted.LoginPwd,ChannelNo=deleted.ChannelNo FROM CallCenter.dbo.Employee,deleted WHERE Employee.EmployeeNo=deleted.LoginName
------解决方案--------------------
--两表关联字段自己补上 Update Employee Set EmployeeNo=deleted.LoginName,EmployeeName=deleted.UserName,Password=deleted.LoginPwd,ChannelNo=deleted.ChannelNo FROM CallCenter.dbo.Employee a join deleted b on (a.关联字段=b.关联字段) WHERE EmployeeNo='@LoginName'
------解决方案--------------------
--应该这样更新... Update a Set EmployeeNo=b.LoginName,EmployeeName=b.UserName,Password=b.LoginPwd,ChannelNo=b.ChannelNo FROM CallCenter.dbo.Employee a join deleted b on (a.关联字段=b.关联字段) WHERE a.EmployeeNo=@LoginName
------解决方案--------------------
--确定这是关联条件的话用下面试试,然后update触发下,看看有没走到1,然后有没走到2? print 1 Update a Set EmployeeName=b.UserName,Password=b.LoginPwd,ChannelNo=b.ChannelNo FROM CallCenter.dbo.Employee a join deleted b on (a.EmployeeNo=b.LoginName) WHERE a.EmployeeNo=@LoginName print 2