Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if exists(select * from sys.triggers where parent_id = object_id('Users') and name = 'SuncUserPassword')
- Drop trigger dbo.SuncUserPassword
- GO
- Create trigger dbo.SuncUserPassword on dbo.Users for Update as
- Begin
- declare @companyID int
- select @companyID = CompanyID from inserted
- Update u Set Password = i.Password from [dbo].[Users] u
- inner join inserted i on u.CompanyID <> @companyID and u.Username = i.Username
- Where u.CompanyID > 1
- End
Add Comment
Please, Sign In to add comment