SqlSELECT TOP 25 [.].[item] as [item], [.].[alias] as [alias], [.].[itemtype] as [itemtype], [.].[minorversion] as [minorversion], [.].[description] as [description], [.].[eventtime] as [eventtime], [.].[folderrelativepath] as [folderrelativepath], [.].[copyto] as [copyto], [.].[sharewith] as [sharewith], [.].[name] as [name], [.].[objtype] as [objtype], [.].[workspace] as [workspace], [.].[status] as [status], [.].[editby] as [author], [.].[reviewby] as [reviewby], [.].[approveby] as [approveby], [.].[latest] as [latest], [.].[latestapproved] as [latestapproved], [.].[obsolete] as [obsolete], [.].[predecessor] as [predecessor], [.].[rejected] as [rejected], [.].[date1] as [date1], [.].[date2] as [date2], [.].[date3] as [date3], [.].[date4] as [date4], [.].[date5] as [date5] FROM [highstage].[dbo].[item] AS [.] WHERE ([.].[latest]=1 AND [.].[obsolete]=0) AND ((CAST([.].[objtype] as VARCHAR(16)) = 'doc')) AND ( [.].[copyto] like '%;everyone;%' OR [.].[copyto] like '%;iusr;%' OR [.].[sharewith] like '%;everyone;%' OR [.].[sharewith] like '%;iusr;%' OR [.].[workspace] IN (SELECT Obj FROM [highstage].[dbo].[entity] WHERE trustees LIKE '%;everyone;%' OR trustees LIKE '%;iusr;%') OR [.].[editby] LIKE '%;IUSR;%' OR [.].[editby] LIKE '%;IUSR;%' OR [.].[reviewby] LIKE '%;IUSR;%' OR [.].[approveby] LIKE '%;IUSR;%') ORDER BY [.].[eventtime] desc,[.].[item]