if exists(select * from sys.all_columns ac where ac.name = 'TFOMSbranch' and ac.object_id = OBJECT_ID(N'FIES.T_MO'))
begin

	exec sp_executesql N'TRUNCATE TABLE FIES.T_TFOMS_BRANCH_MO

	INSERT INTO [FIES].[T_TFOMS_BRANCH_MO]
	           ([TfomsBranchMoID]
	           ,[TfomsBranch]
	           ,[Mo])
	SELECT
	           NEWID()--<TfomsBranchMoID, uniqueidentifier,>
	          ,mo.TFOMSBranch--<TfomsBranch, uniqueidentifier,>
	          ,mo.MCOD--<Mo, varchar(6),>)
	from FIES.T_MO mo
	where mo.TFOMSBranch is not null

	ALTER TABLE FIES.T_MO DROP COLUMN TFOMSBranch'

end
