解决方案:
更新语句如下,在查询分析器对相应帐套数据库执行:UPDATE BD_BusinessObjects
SET MetaInfo ='
SELECT DispatchList.cDLCode AS 单据编号,DispatchList.dDate AS 日期,DispatchList.cDefine1 AS cDefine1,DispatchList.cVerifier AS 审核人,
Department.cDepName AS 部门名称,Person.cPersonName AS 业务员,Customer.cCusName AS 客户名称,DispatchLists.iQuantity AS 数量,
DispatchLists.iNatMoney AS 本币无税金额,DispatchLists.iNatTax AS 本币税额,DispatchLists.iNatSum AS 本币价税合计,
DispatchLists.iNatDisCount AS 本币折扣额,Warehouse.cWhName AS 仓库名称,Inventory.cInvcode AS 存货编码,Inventory.cInvName AS 存货名称,
Inventory.cInvStd AS 规格型号,InventoryClass.cInvCCode AS 存货分类编码,InventoryClass.cInvCName AS 存货分类名称,Inventory.bFree1 AS 存货自由项1,
Inventory.bFree2 AS 存货自由项2,Inventory.bFree3 AS 存货自由项3,Inventory.bFree4 AS 存货自由项4,Inventory.bFree5 AS 存货自由项5,
Inventory.bFree6 AS 存货自由项6,Inventory.bFree7 AS 存货自由项7,Inventory.bFree8 AS 存货自由项8,Inventory.bFree9 AS 存货自由项9,
Inventory.bFree10 AS 存货自由项10,Inventory.cInvDefine1 AS 存货自定义项1,Inventory.cInvDefine2 AS 存货自定义项2,Inventory.cInvDefine3 AS 存货自定义项3,
Inventory.cInvDefine4 AS 存货自定义项4,Inventory.cInvDefine5 AS 存货自定义项5,Inventory.cInvDefine6 AS 存货自定义项6,
Inventory.cInvDefine7 AS 存货自定义项7,Inventory.cInvDefine8 AS 存货自定义项8,Inventory.cInvDefine9 AS 存货自定义项9,
Inventory.cInvDefine10 AS 存货自定义项10,Inventory.cInvDefine11 AS 存货自定义项11,Inventory.cInvDefine12 AS 存货自定义项12,
Inventory.cInvDefine13 AS 存货自定义项13,Inventory.cInvDefine14 AS 存货自定义项14,Inventory.cInvDefine15 AS 存货自定义项15,Inventory.cInvDefine16 AS 存货自定义项16,
CONVERT ( VARCHAR (24),DispatchList.DLID ) AS DLID, a.enumname as 退货标识
FROM DispatchList LEFT JOIN Department ON DispatchList.cDepCode = Department.cDepCode LEFT JOIN Person ON
DispatchList.cPersonCode = Person.cPersonCode LEFT JOIN Customer ON DispatchList.cCusCode = Customer.cCusCode
INNER JOIN DispatchLists ON DispatchList.DLID = DispatchLists.DLID LEFT JOIN Warehouse ON DispatchLists.cWhCode = Warehouse.cWhCode
left join v_aa_enum a on a.enumtype=''sa.boolean2'' and a.enumcode=convert(nvarchar(10),isnull(DispatchList.bReturnFlag,0))
LEFT JOIN Inventory ON DispatchLists.cInvCode = Inventory.cInvCode INNER JOIN
InventoryClass ON Inventory.cInvCCode = InventoryClass.cInvCCode
where ( Dispatchlist.ddate >=(select isnull(cValue,''1900-01-01'')
from accinformation where cSysid=''Sa'' and cName=''dStartDate'' ) or Dispatchlist.bfirst = 1 )
'
WHERE (MetaID = N'ee6b541f-ecb1-417f-a9e6-3dfd62da5d42')