SQL mail thru Stored Procs ?

SQL mail thru Stored Procs ?

Post by karthi » Thu, 13 Dec 2001 14:29:56



Hi,

Is it possible to write a Stored Procedure that will run once in a day and
check in the SQL Server database for certain entries.

And if the condition is satisfied, it has to send a mail.

Is this possible ? If yes, please do guide me.

Actually, what i need to achieve is check whether a user has logged into my
forum in the last 24 hours and if he hasn't then it has to send the user a
reminder about the same. There is a field in the database which has the last
log in time.

So how do i go about it ?

Thanks,
Karthik.

 
 
 

SQL mail thru Stored Procs ?

Post by oj » Thu, 13 Dec 2001 15:46:56


karthik,

yes, it is posible.

http://msdn.microsoft.com/library/en-us/adminsql/ad_1_server_8xf0.asp

-oj


Quote:> Hi,

> Is it possible to write a Stored Procedure that will run once in a day and
> check in the SQL Server database for certain entries.

> And if the condition is satisfied, it has to send a mail.

> Is this possible ? If yes, please do guide me.

> Actually, what i need to achieve is check whether a user has logged into
my
> forum in the last 24 hours and if he hasn't then it has to send the user a
> reminder about the same. There is a field in the database which has the
last
> log in time.

> So how do i go about it ?

> Thanks,
> Karthik.


 
 
 

SQL mail thru Stored Procs ?

Post by Mani » Fri, 14 Dec 2001 15:04:03


Hi karthik,

it is possible and simple one.

1.
write down your conditions in a vbs file.
and save it in your file structure.

2.a
create a job in sql and call that vbs files and schedule it as u need.

or

2b.
you can call that vbs file thru window "Schedule Task"

--
Regards,
Mani kkandan R


Quote:> Hi,

> Is it possible to write a Stored Procedure that will run once in a day and
> check in the SQL Server database for certain entries.

> And if the condition is satisfied, it has to send a mail.

> Is this possible ? If yes, please do guide me.

> Actually, what i need to achieve is check whether a user has logged into
my
> forum in the last 24 hours and if he hasn't then it has to send the user a
> reminder about the same. There is a field in the database which has the
last
> log in time.

> So how do i go about it ?

> Thanks,
> Karthik.