DOS Batch File Running osql - opening/closing connections
am 20.07.2007 14:14:06 von Stephen2
I've written a small dos batch script that runs a simple query through
osql and then calls an exe which sends an email if the returned value
> 0.
The query checks if a value in a column has not been updated for 5
mins and raises a warning through an email and it will need to run
throughout the online day.
Will there be any issues continually opening & closing connections in
this way?
Would there be any advantage in scheduling it as a job in Windows v a
scheduled job in SQL Server to run every 5 mins?
Thanks.
Re: DOS Batch File Running osql - opening/closing connections
am 20.07.2007 14:40:12 von Dan Guzman
I don't see a problem with running a polling process like this every 5
minutes. Personally, I'd do this in SQL Agent job with a single
Transact-SQL step and use database mail if SQL 2005 or xp_smpt_sendmail
(http://www.sqldev.net/xp/xpsmtp.htm) if SQL 2000.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Stephen2" wrote in message
news:1184933646.002428.32730@57g2000hsv.googlegroups.com...
> I've written a small dos batch script that runs a simple query through
> osql and then calls an exe which sends an email if the returned value
>> 0.
>
> The query checks if a value in a column has not been updated for 5
> mins and raises a warning through an email and it will need to run
> throughout the online day.
>
> Will there be any issues continually opening & closing connections in
> this way?
>
> Would there be any advantage in scheduling it as a job in Windows v a
> scheduled job in SQL Server to run every 5 mins?
>
> Thanks.
>
Re: DOS Batch File Running osql - opening/closing connections
am 20.07.2007 15:01:29 von Stephen2
On Jul 20, 1:40 pm, "Dan Guzman"
online.sbcglobal.net> wrote:
> I don't see a problem with running a polling process like this every 5
> minutes. Personally, I'd do this in SQL Agent job with a single
> Transact-SQL step and use database mail if SQL 2005 or xp_smpt_sendmail
> (http://www.sqldev.net/xp/xpsmtp.htm) if SQL 2000.
>
Thanks Dan, that would be a better way but I couldn't get either sql
mail or xp_smpt_sendmail to work. It's a bit like the blind leading
the blind here. I just need a quick & easy solution in the short term.