我正在尝试使用 BizTalk 适配器(SQL 或 WCF-SQL)来创建多级分层架构。我的查询是这样的
SELECT
CustomerQueueMessage.customer_queue_ID AS CustomerQueueMsgID,
CustomerMaster.customer_ID AS [CustomerID],
CustomerAddressType.address_type_ID AS [AddressTypeID],
CustomerSalesRep.sales_rep_type_code AS [SalesRepTypeCode]
FROM CustomerQueue AS CustomerQueueMessage
INNER JOIN dbo.MDM_Customer AS CustomerMaster ON (CustomerQueueMessage.customer_queue_ID = CustomerMaster.customer_queue_ID)
INNER JOIN dbo.MDM_CustomerAddressType AS CustomerAddressType ON (CustomerAddressType.customer_queue_ID = CustomerMaster.customer_queue_ID)
INNER JOIN dbo.MDM_CustomerSalesRep AS CustomerSalesRep ON (CustomerSalesRep.customer_queue_ID = CustomerMaster.customer_queue_ID)
FOR XML AUTO, TYPE, ELEMENTS, XMLDATA
当我使用 SQL 适配器生成架构时,我得到了这个结构
我想要的是
表CustomerSalesRep在CustomerAddressType下。我希望CustomerSalesRep与CustomerAddressType处于同一级别,两者都在CustomerMaster下。
如果我删除 FOR XML 语句并使用 WCF-SQL 适配器生成架构,我没有层次结构,所有列都在同一级别。
有任何想法吗?最好我想使用 WCF-SQL 适配器来完成,但 SQL 也可以。