January 6, 2010 at 6:34 am
Hi ,
I have a query which i need to run once in a month (because data gets updated )manually.Is there any way to avoid that and make it automatic...
Thanks
January 6, 2010 at 6:46 am
Yes, absolutely
Create a stored procedure, and then use the Schedule to fire it off when ever you need. Create a SQL Job and then schedule that job. You can fire the job off as quick as every 1 second, of every day of the week.
Read the SQL Books Online. The BOL are the very best in telling you what SQL Server can do, how to do it, the syntax and examples.
I do not advise simply placing the query into the job, although the SQL job has that capability. To be more secure, use a stored procedure, that way you can always change the query easily but not have to stop the job from firing off.
Andrew SQLDBA
January 6, 2010 at 9:47 am
Thank you
January 12, 2010 at 3:58 am
itskumar2004 (1/6/2010)
Hi ,I have a query which i need to run once in a month (because data gets updated )manually.Is there any way to avoid that and make it automatic...
Thanks
Just a side note, if the query ends up in a report, this is something I do in Excel. Using the external data source option add your query directly into Excel. Then when you pull it up and get prompted for the refresh just say yes. Your report will always reflect the latest changes on the database.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply