--modifies the Functionno node value, @OperateFunctionNo the parameter set @DataXml. Modify (' Replace value of ' (/cruddata/functionno/text ()) [1] With Sql:variable ("@OperateFunctionNo")
--delete node set @DataXml. Modify (' Delete (/cruddata/datakey) [1] ')
--Insert node set @DataXml. Modify (' Insert <DataKey></DataKey> as first into (/cruddata) [1] ')
--Insert text set @DataXml. Modify (' Insert Text{sql:variable (@DataKey)} as first into (/cruddata/datakey) [1] ')
The--datakeylist value gets the set @DataKeyList = @DataXml. Value (' (/cruddata/datakeylist) [1] ', ' nvarchar (max) ')
The XML text is
<CrudData> <ConnKey>SupplierData</ConnKey> <AppNo>20</AppNo> < functionno>200000</functionno> <Command>DoApproveSubjectList</Command> < Datakeylist>3210002010402020170508000004,3210002010402020170228000002</datakeylist> < Approvalresult>2</approvalresult> <operatefunctionno>204020</operatefunctionno></ Cruddata>
SQL Server Common Operations xml