Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Branching to SQL agents Jobs

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-07-30 : 08:00:38
Rajeev writes "We have 3 servers production/reports and Backup

The production and reports are sybase server. Backup is a sql server. The reports contains a replica copy of the production. There sql jobs which run on backup Sql server thru ODBC connection which extract data from sybase reports to SQL. The problem what we face is if the data is not replicated on reports we get duplicate data on the backup. Is there a way in which we can control the job based on date. if there is no change in the date the date job is not run.

we can use if clause and branch out as

if

(select abc.date as new from abc where
abc.xyz=1 and abc.qwe=20)

<>

(select abc1.date as old from abc1 where
abc1.xyz1=1 and abc1.qwe1=20)

USE msdb
EXEC sp_start_job @job_name = 'updt' @step_name ='step3'

else
USE msdb
EXEC sp_stop_job @job_name = 'updt'



regards
rajeev"

X002548
Not Just a Number

15586 Posts

Posted - 2003-07-30 : 10:49:21
Personally?

I'd have a batchWindow table.

Then I'd have a date added and a date updated column on every data row.

I'd close the batch window with the datetime of the synch process

Get all the rows between the previous window close and this window close

Insert them in the sql server table

and do the same for the updates (just update rather than insert)

Either check history tables or have a logical delete date to perfomr deletes in the same manner..



Brett

8-)
Go to Top of Page
   

- Advertisement -