So I am not 100% sure if I am posting in the right section but I am looking for some help with something.
I have a query that I run every day, that I would like to be a bit more automated. It is a simple select statement that queries a table for values. I would like to make either a batch file, or C++ program that I can setup as a scheduled task to run this query every morning. What is the easiest way in running a select statement from a batch file or C++ program?
If you want to run your script from the application level there is a application named Task Scheduler. It ships with the operating system. Alternately, you could use SQL Server Agent to create and schedule a Task. The task would consist of your script.
================================================= There are two kinds of light -- the glow that illuminates, and the glare that obscures. -James Thurber
Basically documents are scanned and electronically fed into a database. Every day I need to run a report on how many documents were entered into the system the day before, save it as an excel sheet, and email it off to a customer. I am trying to make it so these reports run and save automatically, so all I need to do is email them off.
ok. in that case much better way is to create a report in reporting services. It will have a datasource defined which will connect to your database table and will have a dataset which will run query and populate the data. Inside report you include the columns you want and deploy it in report server. Then in server set a subscription for report by specifing email as delivery option and give required email address and format as Execl. Then it will get rendered in excel format to desired distribution list automatically.