IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_warehouse_operation_all]') AND type = 'V')
DROP VIEW [dbo].[mps_warehouse_operation_all]
GO
create view [dbo].[mps_warehouse_operation_all] as 
SELECT [whop_id]
      ,[whop_cmpid]
      ,[whop_tag]
      ,[whop_prdid]
      ,[whop_whid]
      ,[whop_whid2]
      ,[whop_opdate]
      ,[whop_operation]
      ,[whop_value]
      ,[whop_valuesuspend]
      ,[whop_bizid]
      ,[whop_type]
      ,[whop_no]
      ,[whop_ordid]
      ,[whop_branch]
      ,[whop_depart]
      ,[whop_creator]
      ,[whop_jbid]
 
      ,[whop_unit]
      ,[whop_batch]
      ,[whop_price]
      ,[whop_expire]
      ,[whop_note]
      ,whop_accountdate
      ,[whop_location]
  FROM mps_warehouse_operation 
  union
  select 
  [whop_id]
      ,[whop_cmpid]
      ,[whop_tag]
      ,[whop_prdid]
      ,[whop_whid]
      ,[whop_whid2]
      ,[whop_opdate]
      ,[whop_operation]
      ,[whop_value]
      ,[whop_valuesuspend]
      ,[whop_bizid]
      ,[whop_type]
      ,[whop_no]
      ,[whop_ordid]
      ,[whop_branch]
      ,[whop_depart]
      ,[whop_creator]
      ,[whop_jbid]

      ,[whop_unit]
      ,[whop_batch]
      ,[whop_price]
      ,[whop_expire]
      ,[whop_note]
      ,whop_accountdate
      ,[whop_location]
  FROM mps_warehouse_operation_history