I got various Job Details listed in my table. I have set all jobs in a
such a way that they will be LIVE when Flag=1 and EXPIRED when Flag=0.
But how can I compare the Expiry Job Date with the Current Date and
Update Flag=0 automatically when its expired. I probably need compare
everyday.
I have no clue how to do this. I looked at Triggers but may be its not
the one i'm looking for..
Is this possible in SQL Server?
Thanks in Advance for your time and helpsomething like this:
update jobs
set flag=0
where expiry_date=convert(varchar(8),getdate()
,112)
set up a job to run this update daily.
however, it seems redundant, to have both the expiry date and the flag in
the table.
dean
"savvy" <johngera@.gmail.com> wrote in message
news:1138960957.385296.309670@.g47g2000cwa.googlegroups.com...
>I got various Job Details listed in my table. I have set all jobs in a
> such a way that they will be LIVE when Flag=1 and EXPIRED when Flag=0.
> But how can I compare the Expiry Job Date with the Current Date and
> Update Flag=0 automatically when its expired. I probably need compare
> everyday.
> I have no clue how to do this. I looked at Triggers but may be its not
> the one i'm looking for..
> Is this possible in SQL Server?
> Thanks in Advance for your time and help
>|||Thank you very much for your help Dean
I created a job in SQL Server and its working fine
Thanks in once again
Wednesday, March 7, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment