Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update a column every Monday automatically.

Status
Not open for further replies.

nrugado

Programmer
Dec 10, 2002
42
US
I have an access front end tied to a sql back end db. I have the need to update a column on any row that equals 0 to the value of 1, and have sql server update this each Monday. Any help would be greatly appreciated.

Thanks

Table name: employees column: reportmarker
 
Do you have access to the SQL Server schedule functions?

If you do then you should simply create a new job that runs every Monday at a time prior to your business day start time. The job would call a stored procedure to do the update. This, by far, is the better approach due to the fact that (presumably) the SQLServer would not be shut down, whereas your PC probably is in your absence (or you could be on holiday).

Alternatively, if you can't do that, then you could set up a Windows Scheduled Task that runs on Monday (could be on your specific PC even) that calls an ACCESS app that does the update via the ODBC connection (that you obviously already have).

I've given you a couple of directions to go for starters, but if you need more help just let us know...
 
Yes, I do have access to schedule functions. I think the help I need is creating the stored procedure. Any help is greatly appreciated. Thanks
 
Code:
UPDATE employees
SET reportmarker = 1
WHERE reportmarker = 0

Set up a job in SQL Agent that runs that query whenever you want on Monday.

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top