use wtu go --单据对照表 if exists (select * from sysobjects where id = object_id('dbo.usp_datamaps') ) drop view dbo.usp_audit go Create view usp_audit as select '其他入库单' as vouchertype,ccode,ddate from UFDATA_002_2019..rdrecord08 where dnverifytime is null union select '其他出库单' as vouchertype,ccode,ddate from UFDATA_002_2019..rdrecord09 where dnverifytime is null union select '采购入库单' as vouchertype,ccode,ddate from UFDATA_002_2019..rdrecord01 where dnverifytime is null union select '采购退货单' as vouchertype,ccode,ddate from UFDATA_002_2019..PU_ArrivalVouch where caudittime is null union select '销售发货单' as vouchertype,cDLCode,ddate from UFDATA_002_2019..DispatchList where dverifysystime is null union select '采购订单' as vouchertype,cPOID,dPODate from UFDATA_002_2019..PO_Pomain where cAuditTime is null go