开发者

Cannot find either column "" or the user-defined function or aggregate "", or the name is ambiguous

开发者 https://www.devze.com 2023-02-15 23:08 出处:网络
I\'m getting the above warning in some T-SQL I\'m working on that uses an XML data type. The code runs as expected, but the warning is annoying, as it shows up in the editor and when I build my databa

I'm getting the above warning in some T-SQL I'm working on that uses an XML data type. The code runs as expected, but the warning is annoying, as it shows up in the editor and when I build my database project in VS2010. Here's a sample:

DECLARE @ID TABLE (ID INT)

INSERT @开发者_如何学编程ID VALUES(1)
INSERT @ID VALUES(2)
INSERT @ID VALUES(3)

DECLARE @IDXml XML
SET @IDXml = (
    SELECT ID FROM @ID FOR XML RAW('IDFilter')
)

-- Cannot find either column "item" or the user-defined function or aggregate
-- "item.value", or the name is ambiguous.
SELECT SomeID = item.value('@ID', 'INT')
FROM @IDXml.nodes('/IDFilter') AS T(item)

Is the warning normal, or am I doing something wrong?


Try to add:

SET 'ANSI_PADDING' ON
0

精彩评论

暂无评论...
验证码 换一张
取 消