UPDATE VS4TTRANSFERTYPE SET TTFTAlias=TTFTTSHFCode

UPDATE VS4TInventory set tinvrefno4=tinvno

UPDATE VS4TInventory set tinvno=tinvrefno where(tinvrefno is not null)AND
(tinvtintalias='BORROW' OR tinvtintalias='BORROWBACK' or tinvtintalias='BUILT' or
tinvtintalias='BUILTOUT' or  tinvtintalias='CHANGESTATUS' or tinvtintalias='RECEIVEBORROW' or
tinvtintalias='RECEIVEFGBUILT' or tinvtintalias='RECEIVEFGBUILTOUT' or 
tinvtintalias='RECEIVESCRAPBUILT' or tinvtintalias='RECEIVESCRAPBUILTOUT' or tinvtintalias='RECEIVEWIPBUILT' or
tinvtintalias='RECEIVEWIPBUILTOUT' or tinvtintalias='RETURNBUILT' or tinvtintalias='RETURNBUILTOUT' or
tinvtintalias='SENDCONSIGN' or tinvtintalias='SENDCONSIGNRETURN' or tinvtintalias='TRANSFER' or
 tinvtintalias='DEPACK' or  tinvtintalias='PACK' or tinvtintalias='PACKWIP' or tinvtintalias='REUNIT')

UPDATE VS4TInventory set tinvrefno=(select ttfrrefno from vs4ttransfer where tinvno=ttfrno)
UPDATE VS4TInventory set tinvFromTBraCode=(select ttfrFromTBraCode  from vs4ttransfer where tinvno=ttfrno)
UPDATE VS4TInventory set tinvrefno=(select tpckrefno  from vs4tPACK where tinvno=tpckno)

update vs4tinventory set tinvtintalias='TRANSFER' where tinvtintalias='STOCKTRANSFER'
update vs4ttransfer set ttfrttftalias='TRANSFER' where ttfrttftalias='STOCKTRANSFER'
update vs4tinventorymb set tinmtintalias=(select tinvtintalias from vs4tinventory where tinvno=tinmtinvno)

--update vs4ttransfermb set ttfmtfttalias=(select ttfrttftalias from vs4ttransfer where ttfrno=ttfmttfrno)