Sample Header Ad - 728x90

XML datatype instance has too many levels of nested nodes. Maximum allowed depth is 128 levels

2 votes
2 answers
2440 views
This is the error message I get when running the query below: > Msg 6335, Level 16, State 102, Line 43 XML datatype instance has too > many levels of nested nodes. Maximum allowed depth is 128 levels.
SELECT *, cast(plantext as xml)
  FROM [my_database].[dbo].[the_PlanHistory]
  where servername='myServer'
  and procname='MyProcedure'
  order by cachedtime desc
I know the problem is related to the cast to xml, how can I fix it, or work around it?
Asked by Marcello Miorelli (17274 rep)
Jun 28, 2023, 11:19 AM
Last activity: Jul 5, 2023, 06:47 PM