/ Published in: SQL
Expand |
Embed | Plain Text
Adding element INTO the XML DATA INSERT Expression1 ( {AS first | AS last} INTO | after | before Expression2 ) SET @xmlDoc.MODIFY(' insert element UpdateDatetime {"2010-10-28T13:49:27.330"} before or after (/t/AuditID)[1] ') SET @xmlDoc.MODIFY(' insert <UpdateDatetime>2010-10-28T13:49:27.330</UpdateDatetime> as last or as first or into(/t)[1]') IF (@xmlDoc.exist('/t/UpdateDatetime')=0) BEGIN SET @xmlDoc.MODIFY(' insert <UpdateDatetime>2010-10-28T13:49:27.330</UpdateDatetime> as last into(/t)[1]') END *Adding element WITH dynamic DATA FROM the sp parameters WITH condition. IF (@xmlDoc.exist('/t/UpdateDatetime')=0) BEGIN SET @xmlDoc.MODIFY(' insert element UpdateDatetime {sql:variable("@dtmCurrentDate")} as last into(/t)[1]') END
You need to login to post a comment.
