Cannot start SQL Agent in SQL Server 2008 Express - sql-server-2008-express

So my SQL Server Express version does not allow the SQL Agent service to run. I want to automate a query to execute about every 10 seconds. I suppose, given my task, it could be done every minute.
Is there a way to execute an automated SQL query without the SQL Agent? I am seeing all kinds of different ways, but not sure which to use.
How do I schedule a windows task to run the SQ Query?
Thanks in advance for your valued assistance.

Related

How to Execute SQL Server query (procedure) from another PC in network

Situation now
We have a netrowk set up. Some PCs have SQL Server 2012 installed, some don`t.
Is it possible to write a stored procedure and have it invoked/executed by another user/PC without SQL Server? For example by some .bat/.cmd script, I don`t know.
Desired situation
I write SQL query on my SQL Server management studio.
I save the query as a stored procedure. <-- up to here I am OK.
I do something that makes the procedure availible to other users. The advice I get from this question (I hope).
Other colleagues execute the procedure.
They get a result of the query in a CSV.
The client computers that need to run the stored procedure could install the sqlcmd utility. This allows for the execution of sql commands on another SQL Server.
SQLCmd -S<<SERVERNAME\INSTANCENAME>> -Q "Execute dbo.YourStoredProcedure"
And then have your stored procedure save the CSV file to a network drive or send it via e-mail.
Another way to retrieve data could be using the BCP utility. In this way the user could connect to your server, execute the query and receive a CSV file to a specified location on their computer.
In both cases it involves installing an additional program on the client computer.
You don't need SQL Server installed in the client machines to run queries or execute procedures. At most, depending on which programming language you are are using, you need the client installation for SQL Server. This is true for any DBMS, even Microsoft SQL Server 2014.
If you implement you code in Java, for example, you don't need even the MS SQL Server client. The JDBC driver for MS SQL Server is enough. It can be download from Microsoft and is not part of the SQL Server client installation.

Schedule a job to run only if another job is not currently running in Microsoft SQL Server Management Studio

Currently have 2 jobs that can't run in parallel. Is there a way I can defer the execution based on the status? So MAG_LOGICAR_D3_H should not run if MAG_LOGICAR_D3_M is currently running and vice versa using Microsoft SQL Server Management Studio ?
On way to accomplish this is using a maintenance plan.
Add two: Execute SQL Server Agent Job Task.
Configure the jobs.
Link both jobs.
Force the execution of second job after Success or Completion of the first one.

Get Data from a Website and update a SQL Server 2008 R2 Table

I'm wondering if it is at all possible to take data from a website and update a table in SQL Server 2008 R2 at a given interval of time?
The website in question updates every 5 minutes, changing the values of two numbers. As stated above I'm using SQL Server 2008 R2 and I also have Visual Studio 2013 if that matters at all. I need to take these two numbers every 5 minutes and update a table I have created on the SQL Server.
I know I can use an Excel macro to do this, which I already have done, but my employer wants to bypass this altogether.
If this is possible, say via a VS application, then any helpful links or suggestions would be greatly appreciated.
Thanks in advance!
You can create an SSIS package with a "script task".
This task could read the website and return the information.
Then store it in your table.
To finish configure a job that call this SSIS package every 5 minutes.

Is there a way to run a stored procedure at predefined intervals?

I wanted a stored procedure to run at specified intervals everyday. Is there a way to do the same on SQL Server 2005?
I know we can create a batch file to run SP and schedule it with windows scheduled tasks but is there a way to do it from SQL Server itself?
There's a separate service called SQL Agent, which is created for this specific purpose: scheduling of tasks related to SQL Server.
This is a Windows Service that's initially disabled, so you'll have to enable that. Otherwise, it's all very straightforward: Management Studio has nice UI for managing Agent.
You can create jobs with sql server 2005
Use SQL Agent to schedule jobs.
See Creating Jobs

Is it possible to automate MS SQL Server (2005) queries via SQL Server Management Studio?

I have two queries saved on my SQL Server 2005 and I would like to have them running at certain intervals, e.g. every 24 hours. Is there a way to automate these queries and schedule them via SQL Server Management Studio?
You need to use the SQL Server Agent, installed as part of SQL Server. This is the background service that's responsible for running scheduled maintenance and backup tasks.
Expand the SQL Server Agent node in SQL Server Management Studio, you should see a tree node called "Jobs"
Right-clicking this will give you the option to add a new job. Jobs consist of a series of steps to be executed in order, and when you add a new step to your job, you can choose various types of step, including "Transact-SQL Script"
Create a new job, add a single T-SQL step, put the queries that you want to run into the step properties, and then use the "Schedule" option in the Job properties to create a recurring schedule that'll run the job every 24 hours (or whenever).
You can use the SQL Server Agent, which will allow the server to run the script/stored procedure.
You can also use the Windows Task Scheduler, either on the server or on any other server or workstation to schedule isqlw/sqlcmd to execute your script/stored procedure.
Create a job with a step in which you execute your queries; the job can be scheduled at your needs.
At a previous employer the operations department had a task sheduling application. They prefered to use the command line tools that come with sql server to execute jobs (stored procedures) on a scheduled basis. This way the "task scheduling application" could recieve an exit status (pass/fail, ok/error) and hold up dependent jobs.
I'm sorry I don't remember the name of the command line tool, but it was part of the sql server distro. I also do not remember the name of the task scheduling application. It was not the windows task scheduler. It was something enterprise level used to manage the nightly cycle.
Not sure of the scale of your project, but this is another way to go.
SKapsal's comment on a command line tool for executing SQL commands is a reference to osql (for SQL2000) or sqlcmd (for SQL2005+). You could save your script a file and run it from that command line using Windows Task Scheduler or something similar.
SQL Agent is still the preferred solution, however, as it provides GUI controls for job creation, scheduling, logging and viewing job execution history/results.
how to schedule a job for sql query to run daily?
This is similar question with helpful answer.
Covering simple step by step manual.