ALTER TABLE {databaseOwner}{objectQualifier}DMX_Entries 
ADD LastModified DATETIME

GO

UPDATE {databaseOwner}{objectQualifier}DMX_Entries
SET LastModified = (
SELECT Max({objectQualifier}DMX_Log.Datime) 
FROM {databaseOwner}{objectQualifier}DMX_Log
WHERE (
(({objectQualifier}DMX_Log.Operation)<>'Download')
AND (({objectQualifier}DMX_Log.Operation)<>'Locked')
AND (({objectQualifier}DMX_Log.Operation)<>'Unlocked')
AND ({objectQualifier}DMX_Log.EntId = EntryId)
)
)

GO

UPDATE {databaseOwner}{objectQualifier}DMX_Entries
SET LastModified = GETDATE()
WHERE LastModified IS NULL

GO

ALTER TABLE {databaseOwner}{objectQualifier}DMX_Entries 
ADD Categories NVARCHAR (255)

GO

