SQL Server JOBS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!.

I am developing a windows application where i need to give users alerts about their pending jobs once they login into the application. I am trying to create SQL Server jobs to give those alerts( If anyone has any other option kindly post the same). now can anyone tell me how do i populate the alert on the user machine.

Thanks in advance
Baren
 
I don't think there's any way to do this directly from the alert. One
possibility might be to code the alert so that it writes a row in a
database table, which you can then query in your application. You also
might want to try posting the question in one of the sqlserver
newsgroups where SQL experts might have additional suggestions.

--Mary
 
Baren,
Are you trying to create jobs using DDL? If so there are a set of
stored procedures to both create and query jobs. The same is for Alerts.
For example the sp_add_job stored procedure will create a job. There are
many other procedures to use to get a job into a "runnable" state.
Depending on what information you need there are a set of sp_help_????
procedures to get the information you might be looking for.

The best idea is to use Books Online for all the details.

Lloyd Sheen


Baren said:
Hi!.

I am developing a windows application where i need to give users alerts
about their pending jobs once they login into the application. I am trying
to create SQL Server jobs to give those alerts( If anyone has any other
option kindly post the same). now can anyone tell me how do i populate the
alert on the user machine.
 
Hi! Lloyd,

I have a stored procedure which calls xp_cmdshell, which will send messages to the user. Now i will write a job which will call this stored procedure. Now the problem is how do i schedule it to run only after user logsin into the application and at the specified time only.

Regards,
Baren
 
Baren,
There are two sp's which you could use. The sp_add_jobschedule can be
used to create the schedule for the job to run and sp_delete_jobschedule can
be used to delete the schedule. When the user logs in use sp_add_schedule
specifying the time.

Lloyd Sheen

Baren said:
Hi! Lloyd,

I have a stored procedure which calls xp_cmdshell, which will send
messages to the user. Now i will write a job which will call this stored
procedure. Now the problem is how do i schedule it to run only after user
logsin into the application and at the specified time only.
 
Back
Top