This SQL script will get a list of the latest versions of all Database documents in the portal that are locked.
SELECT Version.[VersionID]
,Version.[ItemID]
,[Name]
,[LockedOn]
,[LockedBy]
FROM [Production_Portal_PortalFx_Documents].[dbo].[Version]
INNER JOIN Production_Portal_PortalFx_Documents.dbo.Item on Item.ItemID = Version.ItemID
INNER JOIN (SELECT max([VersionID]) as VersionID
,[ItemID]
FROM [Production_Portal_PortalFx_Documents].[dbo].[Version]
group by ItemID) z on z.itemid = version.itemid and z.versionid = version.versionID
where lockedon is not null
Comments
0 comments
Please sign in to leave a comment.