I either need to have a job not start if the table is empty or
stop if it is empty.
I Think the the latter would be something like the following
job steps
step 1) count records - success = next step - failure = end job with failure
step 2 ) dts file.
step logic:
step 1) select count(*) from tablea
if count = 0 then set @.@.error = 999 /*or what ever causes job
to fail
else
continue to create file for dts step.
step 2) dts job to export data.
TIAYes, I think you're on the right track. The job's first step could be a
stored proc that does something like this:
select @.RecCount = count(*) from tablea
IF @.RecCount = 0
Begin
Raiserror('Tablea is empty.', 16, 1)
Return 16
End
hth
Tom
tdr wrote:
>I either need to have a job not start if the table is empty or
> stop if it is empty.
>I Think the the latter would be something like the following
>job steps
>step 1) count records - success = next step - failure = end job with failure
>step 2 ) dts file.
>step logic:
>step 1) select count(*) from tablea
> if count = 0 then set @.@.error = 999 /*or what ever causes job
>to fail
> else
> continue to create file for dts step.
>step 2) dts job to export data.
>TIA
>
--
E-mail correspondence to and from this address may be subject to the
North Carolina Public Records Law and may be disclosed to third parties.
Showing posts with label empty. Show all posts
Showing posts with label empty. Show all posts
Friday, February 24, 2012
Subscribe to:
Posts (Atom)