How can we help you today? How can we help you today?
TSchwab
Anu Deshpande wrote: Apologies that the suggestion didn't help. Can you send us the complete query so that we can understand the scenario and replicate the issue? Here is a sample code: DECLARE @XML XML SET @XML = (SELECT ID , LastName , FirstName FROM ( SELECT 1 AS ID , 'LastName1' AS LastName , 'FirstName1' AS FirstName UNION SELECT 2 AS ID , 'LastName2' AS LastName , 'FirstName2' AS FirstName UNION SELECT 3 AS ID , 'LastName3' AS LastName , 'FirstName3' AS FirstName) AS NameList FOR XML AUTO, TYPE ) SELECT T.C.VALUE('@ID', 'INT') AS ID , T.C.VALUE('@LastName', 'NVARCHAR(100)') AS LastName , T.C.VALUE('@FirstName', 'NVARCHAR(100)') AS FirstName FROM @XML.nodes('/NameList') T(C) If I execute the code I get the error message: Msg 227, Level 15, State 1, Line 21 "VALUE" is not a valid function, property, or field. "value" is case sensitive and must be in lower case. SQLPrompt changes the value always to upper case. It must look like this: SELECT T.C.value('@ID', 'INT') AS ID , T.C.value('@LastName', 'NVARCHAR(100)') AS LastName , T.C.value('@FirstName', 'NVARCHAR(100)') AS FirstName FROM @XML.nodes('/NameList') T(C) / comments
Anu Deshpande wrote: Apologies that the suggestion didn't help. Can you send us the complete query so that we can understand the scenario and replicate the issue? Here is a sample code: DECLAR...
0 votes