Hi,

I have created a stored Procedure.Inside this stored Proc another client proc Executes.
I have to pass @statdate and @enddate parameter values. I need to extract last 5 days of data
So I have declared two variables @sdate and @edate, values getdate()-5 and getdate().
Client Proc insert the extracted data in a temp table.
According to the req I have to first delete 5 days of data from destination table and then Insert
data from temp table to destination,In case of job failure we do not loose any data.
I cannot truncate the table because it is a huge table.
I do not have any Pk on the table and I cannot define one.
Please help

Ex of my stored Proc--

Create Procedure Test

AS

Begin Try

Declare @sdate datetime,
@edate datetime

Set @sdate = getdate()-5,
@edate = getdate()


If object_id('abc_temp) is not null
drop table abo_temp

Exec client_proc
-----
-----
-----
@startdate = @sdate,
@enddate = @edate
-----
-----
@TableUsage = '|CREATE|',
@ResultTableName = 'abc_temp'

Please help

Thanks