Every or some ssrs reports have following tags:
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition"
xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"
xmlns:df="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition/defaultfontfamily"
MustUnderstand="df"
This query doesn't return any data unless I remove the attributes specified above. In the given xml, attributes can't be removed.
declare @content xml =
'<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns:df="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition/defaultfontfamily" MustUnderstand="df">
<DataSets>
<DataSet Name="DS">
<Query>
<CommandText>rep.my_proc</CommandText>
</Query>
</DataSet>
</DataSets>
</Report>'
select
'DB growth' as ReportName,
CommandText = x.value('(Query/CommandText)[1]','VARCHAR(250)')
from @content.nodes('Report/DataSets/DataSet') r (x)
Is there any error in that query?
WITH XMLNAMESPACES(DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition' )before theSELECT