嗨,下面是我的存储过程:
ALTER PROCEDURE [dbo].[IsRegionNameAllowed] (@RegionName VARCHAR(200),
@RegionId INT)
AS
BEGIN
--Region Name Duplicate Check
DECLARE @IsExist BIT
SET @IsExist=0
IF EXISTS(SELECT *
FROM (SELECT DISTINCT EntityID,
ResultObject.value('
declare default element namespace "http://schemas.datacontract.org/2004/07/LPSFS.Entity";
(/RegionQueueEntity/Region/RegionName)[1]', 'varchar(200)') AS RegionName
FROM TransactionLPS t
JOIN servistreammyqueue my
ON t.servistreamtransactionid = my.servistreammyqueueid
JOIN lkpqueuestatus lkp
ON my.queuestatusid = lkp.queuestatusid
WHERE SubContextID IN (SELECT ContextID
FROM lkpcontext
WHERE ContextCode = 'RGMCTX0002')
AND EntityID <> @RegionId) AS RegName
WHERE ( lower(RegName.RegionName) = lower(@RegionName)
AND lkp.queuestatuscode = 'QSTAPP' ))
SET @IsExist=1
END
但它在 lkp.queuestatuscode 中给出错误,即(无法绑定多部分标识符)。请帮忙