MSSQLServer. When the AccountId, the PASSWORD update is updated, the corresponding information of the username table is automatically updated.
Design AccountId as the foreign key in the relational table, and the following is the trigger change of Password.
CREATE TRIGGER change_agent ON dbo.agentINFO for UPDATEASdeclare @password_i varchar (10) declare @accountID_d varchar (10) set @ accountID_d = (select d.accountID from Deleted as d) set @ password_i = (select i.password from Inserted as i) If Update (Password) BeginUpdate UserName Set Password = @password_i where accountid = @ Accountid_Dend