Forum Discussion
Anonymous
9 years agoNot applicable
Power BI Report Server dbo.Catalog table
HI, I'm trying converting content data from dbo.Catalog table of my Power Bi Report Server Database, but conversion of data about type = 13 (pbix files) return me an issue: XML parsing line 1 ch...
v-yulgu-msft
9 years agoMicrosoft Employee
Hi Anonymous,
Not sure what SQL query you were using that resulted above error. Please try below query:
WITH ItemContentBinaries AS
(
SELECT
ItemID,Name,[Type]
,CASE Type
WHEN 2 THEN 'Report'
WHEN 5 THEN 'Data Source'
WHEN 7 THEN 'Report Part'
WHEN 8 THEN 'Shared Dataset'
When 13 Then 'Power BI Report'
ELSE 'Other'
END AS TypeDescription
,CONVERT(varbinary(max),Content) AS Content
FROM ReportServer.dbo.Catalog
WHERE Type in (2,5,7,8,13)
),
--The second CTE strips off the BOM if it exists...
ItemContentNoBOM AS
(
SELECT
ItemID,Name,[Type],TypeDescription
,CASE
WHEN LEFT(Content,3) = 0xEFBBBF
THEN CONVERT(varbinary(max),SUBSTRING(Content,4,LEN(Content)))
ELSE
Content
END AS Content
FROM ItemContentBinaries
)
--The outer query gets the content in its varbinary, varchar and xml representations...
SELECT
ItemID,Name,[Type],TypeDescription
,Content --varbinary
,CONVERT(varchar(max),Content) AS ContentVarchar --varchar
,CONVERT(xml,Content) AS ContentXML --xml
FROM ItemContentNoBOM
Reference: Extract RDL (XML) from the ReportServer database
Best regards,
Yuliana Gu
KBO
7 years agoMemorable Member
I have some supplements:
1= Folder
3 = Templates
:)
Best Kathrin