update vs4tinventoryMB set tinmsourceno=(select tinvrefno from vs4tinventory where tinmtinvno=tinvno) where tinmtintalias='RECEIVEBORROW'
GO
update vs4tinventoryMB set tinmsourceln=(select top 1 tinmln from vs4tinventoryMB A where A.tinmtinvno=tinmsourceno and A.tinmtpdtcode=tinmtpdtcode) where tinmtintalias='RECEIVEBORROW'
GO