2

Ok so I asked a question yesterday about doing a timed procedure. I got some responses about using SQL Server Agent but i found out that I am using Sql server 2008 express RC and its not available.

Here is my first question and I want to know if there is another tool I can use to do a timed procedure with sql server ....thanks again

2 Answers 2

3

You can use scheduled task (control panel-administrative tools) and start a .cmd/.bat file where you use sqlcmd to execute SP's or run scripts.

sqlcmd is a command line tool. sqlcmd /? will show you what you can do with it.

enter image description here

Here is how you can use sqlcmd to execute a SP called StoredProcName in database YourDatabase on server instance ComputerName\sqlexpress.

sqlcmd -S ComputerName\sqlexpress -E -d YourDatabase -Q "exec StoredProcName"

Read more about Using the sqlcmd Utility here http://msdn.microsoft.com/en-us/library/ms180944.aspx

Read about the Task Scheduler here http://msdn.microsoft.com/en-us/library/aa383614%28v=vs.85%29.aspx.

Sign up to request clarification or add additional context in comments.

2 Comments

what do you mean by start a .cmd/.bat file...im more of a mac guy and this windows env is new to me...also is sqlcmd a command or a stand alone program
@Tamer - Updated answer with some more info. I think you don't have to use bat/cmd file. You can use the sqlcmd utility directly from Task Scheduler.
3

You can use dialog timers to start activated procedures. This functionality is available on the Express edition. The advantage over an external service, like Windows Scheduler, is that the solution is self contained inside the database. For example you can move the database to a different computer and the timed procedure will still run, on the new computer, once the database is started. An external service requires you to reconfigure the scheduler agent on the new computer.

1 Comment

It is useful answer for my question :) stackoverflow.com/questions/5847994/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.