DROP PROCEDURE {databaseOwner}{objectQualifier}DMX_GetCollectionContents
GO

CREATE PROCEDURE {databaseOwner}{objectQualifier}DMX_GetCollectionContents
  @ParentId Int, @PortalId Int
AS

SELECT {databaseOwner}{objectQualifier}DMX_Entries.*, LTrim(RTrim({objectQualifier}Users.FirstName+' '+{objectQualifier}Users.LastName)) AS FullName
FROM {databaseOwner}{objectQualifier}DMX_Entries INNER JOIN {databaseOwner}{objectQualifier}Users ON {databaseOwner}{objectQualifier}DMX_Entries.UserId={objectQualifier}Users.UserID
WHERE ((({objectQualifier}DMX_Entries.CollectionId)=@ParentId) And (({objectQualifier}DMX_Entries.PortalId)=@PortalId) And  (({objectQualifier}DMX_Entries.EntryId)=({objectQualifier}DMX_Entries.LastVersionId)))

GO

