i came up with something like this --
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE DDD1
AS
DECLARE @DateDif Datetime
Declare @LastDate Datetime
Declare @Date1 Datetime
Declare @Date2 Datetime
Declare @Date3 Datetime
--SELECT @LastDate = 'select dest_commit_time...