windows - Query SQL for record then send email if none exists -


i've been tasked write application test whether our morning checks have been submitted our database. if not app should email us. needs query database (sql server 2012) entry today's date.

the database small table 8 columns in it: id, username(varchar), datetime(datetime), , more varchar fields comments.

i have not done before i'm assuming i'll have use windows scheduled task? know language should write in?

stack overflow encourages questions specific. sounds may want break project several steps:

1. how query database entry today's date?

in sql server 2012 try this:

select id table t datetime = convert(date,getdate()) 

you can check see if query returned data.

2. scripting language can run query part 1, parse results , send email?

i'm going suggest python - it's easy set up, clean work with, , fun use. stack overflow has many questions , answers python, or feel free ask question if can't find answer already.

here answer on how send emails python script. yuu can read the python docs on sending email.

3. how run script repeatedly every day?

one option create windows scheduled task. here answer superuser, stack overflow's sister site deals using hardware , software.

4. next question?

for future i'd suggest searching site, using search engine, , breaking problems down individual parts. luck!


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -