I am trying to create a stored procedure that accepts XML data as an input parameter but cannot get it to compile. The Code:
CREATE PROCEDURE dbo.idn_UpdateUserApplications
(
@AppIdList xml,
@UserID nvarchar(256),
@ModifiedBy nvarchar(256)
)
AS
BEGIN
SET NOCOUNT ON
INSERT INTO userapplication
(userid,
modifiedby,
modifiedon,
appid)
SELECT @UserID as userid,
@ModifiedBy As modifiedby,
Getdate() as modifiedon,
paramvalues.id.VALUE('.', 'VARCHAR(20)') AS appid
FROM @AppIdList.NODES('/Applications/id') AS paramvalues(ID)
END
The Error: Msg 317, Level 16, State 1, Procedure idn_UpdateUserApplications, Line 13 Table-valued function 'NODES' cannot have a column alias.
NODES
and VALUE
needs to be lower case nodes
, value
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With