question

konmom avatar image
konmom asked

Remove root header from XML used for Deadlock alert

Hi I have a standard WMI deadlock alert and when alert is fired I am inserting the XML into a table but then when I open it the root of the XML is with and I need to deleate it manually as well at the bottom of the XML and then I can save it as .XDL and display it other wise there is error. How can I delete the header and start from the I have tried a lot from the the net but nothing is working to remove the root and leave the rest SELECT DeadlockGraph from [dbo].[DeadlockEvents] FOR XML AUTO, ROOT('deadlock-list') #OR DECLARE @DEL Varchar(10) DECLARE @X XML SET @DEL = 'TextData' SELECT @X = DeadlockGraph from [dbo].[DeadlockEvents] SET @X.modify('delete /TextData[. = sql:variable("@DEL")]') SELECT @X.query ('/') FOR XML AUTO, ROOT('deadlock-list') ---FOR DELETION UPDATE [dbo].[DeadLockTest2] set [col1] = @1 UPDATE dbo.DeadLockTest2 SET col1 = 4 UPDATE dbo.DeadLockTest2 SET col1 = 4 UPDATE [dbo].[DeadLockTest] set [col1] = @1 UPDATE dbo.DeadLockTest SET col1 = 4 BEGIN TRAN UPDATE dbo.DeadLockTest2 SET col1 = 4 UPDATE dbo.DeadLockTest SET col1 = 4 ---FOR DELETION
xmldeadlockwmi
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.