1- 21WITH
3- content_binaries
2+ [ content_binaries]
43AS
54(
65 SELECT
7- cat.[ItemID]
8- , cat.[Name]
9- , cat.[Path]
10- , cat.[Type]
6+ [ cat] .[ItemID]
7+ , [ cat] .[Name]
8+ , [ cat] .[Path]
9+ , [ cat] .[Type]
1110 , [TypeDescription] =
12- CASE cat.[Type]
11+ CASE [ cat] .[Type]
1312 WHEN 2 THEN ' Report'
1413 WHEN 5 THEN ' Data Source'
1514 WHEN 7 THEN ' Report Part'
1615 WHEN 8 THEN ' Shared Dataset'
1716 ELSE ' Other'
1817 END
19- , [Content] = CONVERT (VARBINARY (MAX ), cat.[Content])
18+ , [Content] = CONVERT (VARBINARY (MAX ), [ cat] .[Content])
2019 FROM
21- [dbo].[Catalog] AS cat
20+ [dbo].[Catalog] AS [ cat]
2221 WHERE
2322 1 = 1
24- AND cat.[Content] IS NOT NULL
25- AND cat.[Type] = 2
23+ AND [ cat] .[Content] IS NOT NULL
24+ AND [ cat] .[Type] = 2
2625)
2726,
28- content_binaries_format
27+ [ content_binaries_format]
2928AS
3029(
3130 SELECT
32- bin.[ItemID]
33- , bin.[Name]
34- , bin.[Path]
35- , bin.[Type]
36- , bin.[TypeDescription]
31+ [ bin] .[ItemID]
32+ , [ bin] .[Name]
33+ , [ bin] .[Path]
34+ , [ bin] .[Type]
35+ , [ bin] .[TypeDescription]
3736 , [Content] = -- strip off the BOM if it exist
3837 CASE
39- WHEN LEFT (bin.[Content], 3 ) = 0xEFBBBF THEN CONVERT (VARBINARY (MAX ), SUBSTRING (bin.[Content], 4 , LEN (bin.[Content])))
40- ELSE bin.[Content]
38+ WHEN LEFT ([ bin] .[Content], 3 ) = 0xEFBBBF THEN CONVERT (VARBINARY (MAX ), SUBSTRING ([ bin] .[Content], 4 , LEN ([ bin] .[Content])))
39+ ELSE [ bin] .[Content]
4140 END
4241 FROM
43- content_binaries AS bin
42+ [ content_binaries] AS [ bin]
4443)
4544SELECT
46- cbf.[ItemID]
47- , cbf.[Name]
48- , cbf.[Path]
49- , cbf.[Type]
50- , cbf.[TypeDescription]
51- , cbf.[Content]
52- , [ContentVarchar] = CONVERT (VARCHAR (MAX ), cbf.[Content])
53- , [ContentXML] = CONVERT (XML , cbf.[Content])
45+ [ cbf] .[ItemID]
46+ , [ cbf] .[Name]
47+ , [ cbf] .[Path]
48+ , [ cbf] .[Type]
49+ , [ cbf] .[TypeDescription]
50+ , [ cbf] .[Content]
51+ , [ContentVarchar] = CONVERT (VARCHAR (MAX ), [ cbf] .[Content])
52+ , [ContentXML] = CONVERT (XML , [ cbf] .[Content])
5453FROM
55- content_binaries_format AS cbf
54+ [ content_binaries_format] AS [ cbf]
5655WHERE
5756 1 = 1
58- AND CONVERT (VARCHAR (MAX ), cbf.[Content]) LIKE ' %<subreport%' ;
57+ AND CONVERT (VARCHAR (MAX ), [ cbf] .[Content]) LIKE ' %<subreport%' ;
0 commit comments