UPDATE VS4TSOImigration Set TImgTPdtcode=(select tsobtposcode from vs4tsomb where vs4tsomb.tsobtsodno=VS4TSOImigration.timgtsodno and tsobln=1)
GO
UPDATE VS4TSOImigration Set TImgTPdtcode='' where TImgTPdtcode is null
GO
UPDATE VS4TSOImigration Set TImgTSODNo='' where TImgTSODNo is null
GO
UPDATE VS4TSOImigration Set TImgLn=1  where TImgLn  is null
GO
ALTER TABLE VS4TSOImigration ALTER COLUMN
	TImgTPdtcode nvarchar(30) NOT NULL
GO
ALTER TABLE VS4TVisa ALTER COLUMN
	TVSATPdtcode nvarchar(30) NOT NULL
GO
ALTER TABLE VS4TSOPassenger ALTER COLUMN
	TVSPTPdtcode nvarchar(30) NOT NULL
GO