CREAZIONE NUOVO PROCESSO SQL SERVER AGENT  
Author Message
JeffreyMtl





PostPosted: Thu Feb 08 07:58:29 CST 2007 Top

SQL Server Developer >> CREAZIONE NUOVO PROCESSO SQL SERVER AGENT

Salve a tutti,
ho un problema, devo creare un processo in sql server agent che deve
eseguire una stored procedure.
Se la stored procedure fallisce restituisce un valore intero
particolare che devo intercettare:
esempio:




select
@numeroRisorse =3D count(*)
from
DatabaseName.dbo.Risorse
where
cancellato =3D 0




begin
//qui devo fare si che l'agent sollevi un errore
//e invii una mi invii una mail.....
end

so bene come fare ad inviare una mail nel caso in cui il passo di
processo che esegue il codice sopra riportato fallisce..... ma come
faccio a decidere io quando farlo fallire.... o meglio come fa sql
server agent a capire che se

Grazie mille a tutti.

SQL Server193  
 
 
Immy





PostPosted: Thu Feb 08 07:58:29 CST 2007 Top

SQL Server Developer >> CREAZIONE NUOVO PROCESSO SQL SERVER AGENT Sgr. Presidente,

Qui parliamo in inglese - tu parli un po d'inglese?
io parlo un po d'italiano.

se capisco, vuoi un processo che manda una mail a te? e vero o no?

Immy



Salve a tutti,
ho un problema, devo creare un processo in sql server agent che deve
eseguire una stored procedure.
Se la stored procedure fallisce restituisce un valore intero
particolare che devo intercettare:
esempio:




select
@numeroRisorse = count(*)
from
DatabaseName.dbo.Risorse
where
cancellato = 0




begin
//qui devo fare si che l'agent sollevi un errore
//e invii una mi invii una mail.....
end

so bene come fare ad inviare una mail nel caso in cui il passo di
processo che esegue il codice sopra riportato fallisce..... ma come
faccio a decidere io quando farlo fallire.... o meglio come fa sql
server agent a capire che se

Grazie mille a tutti.


 
 
Presidente





PostPosted: Fri Feb 09 03:38:54 CST 2007 Top

SQL Server Developer >> CREAZIONE NUOVO PROCESSO SQL SERVER AGENT Sorry,
I'll write in english by now.

I explain my problem:
i have a stored procedure that returns me int values and i can
understand if the values are correct just comparign them to another
int value (token from a select statement on another table of my
database).

Now the problem: if i plan to execute this procedure with sql server
agent i want the agent makes this check for me, i mean that if the
value the stored procedure returns is incorrect the step of the sql
server agent precess will fail, and (this is not a problem) sql server
agent will send me an e-mail.

In this way every night the stored procedure will be executed by the
sql server agent, but i'll receive a mail just when the sp will fail.

Thanks in advance.


Immy ha scritto:

> Sgr. Presidente,
>
> Qui parliamo in inglese - tu parli un po d'inglese?
> io parlo un po d'italiano.
>
> se capisco, vuoi un processo che manda una mail a te? e vero o no?
>
> Immy
>


> Salve a tutti,
> ho un problema, devo creare un processo in sql server agent che deve
> eseguire una stored procedure.
> Se la stored procedure fallisce restituisce un valore intero
> particolare che devo intercettare:
> esempio:
>


>
> select

> from
> DatabaseName.dbo.Risorse
> where
> cancellato =3D 0
>

>

> begin
> //qui devo fare si che l'agent sollevi un errore
> //e invii una mi invii una mail.....
> end
>
> so bene come fare ad inviare una mail nel caso in cui il passo di
> processo che esegue il codice sopra riportato fallisce..... ma come
> faccio a decidere io quando farlo fallire.... o meglio come fa sql
> server agent a capire che se

> Grazie mille a tutti.