Hi Graham,

--- Graham Foster
<graham / inca.freeserve.nospam.company.unitedkingdom>
wrote:

> I need to write a SQL report agent. Very simple.
> 
> -) Run various administrative SQL queries against
> different
> databases

What databases are these? Are they heterogeneous?
 
> -) Run as a scheduled job, (under Windows AT command
> I guess) so they
> will be automatically refreshed every 8 hours / day
> / week (or
> whatever frequency it needs doing)

Is using the Scheduler an option?

> - Output would be a textual "report" from the SELECT
> recordset dump,
> do a defined filepath

How about CSV files (or Excel Spread-sheets)?
 
> and/or
> 
> - e-mail (to me) saying all is still well (or not)
> optionally
> including the report

No problem there. We use the "blat" utility although I
think it can be done using pure Ruby just as easily.

> I need to be able to add new scripts easily, and I
> can have a
> dedicated machine running it if necessary (although
> I'd like a
> service.. if this is possible?)

Take a look at win32-utils project on RubyForge.

> If this config doesn't work, then stand-alone EXE's
> would also suit me. I'm assuming that this would be 
> all entirely command line driven with parameter 
> files (or something).

Perfect !
 
> I was about to reach for Perl (as I've done 
> something similar there before), but I think I'd 
> like to try Ruby, anyone give me a start here?

You've come to the right place. Welcome !!!

All what you have described is daily bread and butter
for me (and I suspect many others on this list too). I
program queries for a farm of SQL Server 2000
databases. 

If you could be more specific in what you want I would
gladly share my experience (and some code too).

Feel free to ask ...

> -- 
> Best regards,
>  Graham

-- shanko


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail