Add perent element
I want to add perent element to existing element in xml variable (SQL 2005). I solve that problem with: SELECT @a select @a Is there any simplier solution.
DECLARE @a xml
SET @a = N'<EVENT_INSTANCE><a>CREATE_TYPE</a><b1>2005-10-14T01:58:28.070</b1><c>51</c></EVENT_INSTANCE>'
SET @a.modify(' insert (<AddElement></AddElement>)
after (/EVENT_INSTANCE/a)[1]')
SET @a.modify(' insert /EVENT_INSTANCE/b1
as first into (/EVENT_INSTANCE/AddElement)[1]')
select @a
SET @a.modify(' delete /EVENT_INSTANCE/b1')
SELECT @a
Thanks

