Cannot find either column "" or the user-defined function or aggregate "", or the name is ambiguous
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
精彩评论