DELETE FROM PageRevisionAttachment
WHERE
	PageId = @PageId
	AND PageFileId = @PageFileId
	AND FileRevision = @PreviousFileRevision
	AND PageRevision = @PageRevision;


INSERT INTO PageRevisionAttachment
(
	PageId,
	PageFileId,
	FileRevision,
	PageRevision
)
SELECT
	@PageId,
	@PageFileId,
	@FileRevision,
	@PageRevision;
