Showing posts with label proc. Show all posts
Showing posts with label proc. Show all posts

Monday, March 26, 2012

resetting @@FETCH_STATUS

Hi,
I'm using two cursors in the same proc.
Do I need to reset @.@.FETCH_STATUS before using it to check the status of the
second cursor? If so, how can this be done.
Many thanks for your answers in advance
Ant
You're using nested cursors? I am fairly confident you can avoid that...
help us help you by showing us your code and explaining why two cursors are
needed.
"Ant" <Ant@.discussions.microsoft.com> wrote in message
news:1B8B4F75-06D5-4DE6-A614-55AB5DA602AC@.microsoft.com...
> Hi,
> I'm using two cursors in the same proc.
> Do I need to reset @.@.FETCH_STATUS before using it to check the status of
> the
> second cursor? If so, how can this be done.
> Many thanks for your answers in advance
> Ant
|||You're on the right track. They weren't nested however, they were in line,
but...
Actually, I just readjusted the code so that I put everything in the first
cursor & now have no need for the second.
Sorry to waste your time but thanks very much for your answer none the less
Ant
"Aaron Bertrand [SQL Server MVP]" wrote:

> You're using nested cursors? I am fairly confident you can avoid that...
> help us help you by showing us your code and explaining why two cursors are
> needed.
>
>
> "Ant" <Ant@.discussions.microsoft.com> wrote in message
> news:1B8B4F75-06D5-4DE6-A614-55AB5DA602AC@.microsoft.com...
>
sql

resetting @@FETCH_STATUS

Hi,
I'm using two cursors in the same proc.
Do I need to reset @.@.FETCH_STATUS before using it to check the status of the
second cursor? If so, how can this be done.
Many thanks for your answers in advance
AntYou're using nested cursors? I am fairly confident you can avoid that...
help us help you by showing us your code and explaining why two cursors are
needed.
"Ant" <Ant@.discussions.microsoft.com> wrote in message
news:1B8B4F75-06D5-4DE6-A614-55AB5DA602AC@.microsoft.com...
> Hi,
> I'm using two cursors in the same proc.
> Do I need to reset @.@.FETCH_STATUS before using it to check the status of
> the
> second cursor? If so, how can this be done.
> Many thanks for your answers in advance
> Ant|||You're on the right track. They weren't nested however, they were in line,
but...
Actually, I just readjusted the code so that I put everything in the first
cursor & now have no need for the second.
Sorry to waste your time but thanks very much for your answer none the less
Ant
"Aaron Bertrand [SQL Server MVP]" wrote:
> You're using nested cursors? I am fairly confident you can avoid that...
> help us help you by showing us your code and explaining why two cursors are
> needed.
>
>
> "Ant" <Ant@.discussions.microsoft.com> wrote in message
> news:1B8B4F75-06D5-4DE6-A614-55AB5DA602AC@.microsoft.com...
> > Hi,
> > I'm using two cursors in the same proc.
> > Do I need to reset @.@.FETCH_STATUS before using it to check the status of
> > the
> > second cursor? If so, how can this be done.
> >
> > Many thanks for your answers in advance
> >
> > Ant
>

Wednesday, March 21, 2012

rescheduling sql job

Hi,

I need to reschedule a job. SQL Books suggest using sp_update_jobschedule to update the job.

But the stored proc does not exist on my system and returns:
Could not find stored procedure 'sp_update_jobschedule'

Where can i find sp_update_jobschedule or its equivalent??

regards,
Henryyou can also go into SQL enerprise manager, expand your server name, expand management, and double click on jobs, right click on the job in question and click properties.|||Thanks for the reply Thrasymachus... But i need to reschedule on an event... say, when the admin resets the schedule through application.|||fromm Books Online:

"sp_update_jobschedule must be run from the msdb database.

Updating a job schedule increments the job version number."

Are you executing while logged into the msdb or is your sp execution fully qualified like 'EXEC msdb.dbo.sp_update_jobschedule @.parameters = etc...|||Thanks a million... I was looking for it in master