Store a temporary table and update it every hour [closed] - sql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have never done this before, and I'm not sure if it is possible. Basically, I have a big query that takes around 1-2 minutes to run. What I'd like to do is:
automatically execute and put result into a table every hour.
My webpage will then query against the temporary table instead, which should be quicker.
I am looking for the steps to do this like. First, create a stored procedure. Second, setup somewhere to run the store procedure automatically. I'm not sure how to proceed — can you suggest how?

SQL server supports running scheduled jobs. You can look here.
http://technet.microsoft.com/en-us/library/ms190268%28v=sql.100%29.aspx
Also check this question, it should give you
a very good idea of the steps you need to take.
How to run a stored procedure in sql server every hour?

Related

How to delay all queries for a specified timespan? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I'd like to delay all the queries I receive in my test database for a specified amount of time. My intent in doing this is to test the "loading" feature in my program. I do not want to alter my queries though! WAITFOR doesn't work for me. If possible, the ideal would be to delay all the queries of a specific connection.
Summarizing: I'd like to delay all the queries of my database via some kind of configuration.
How to do that in SQL Server?
To the best of my knowledge, this is not an out-of-the-box feature.
Most people who want to test their data access code write specific test cases to do that. Again, there are lots of different scenarios; the closest to what you describe would be to capture all the requests going to your server, and then write a harness to replay those queries under test conditions.
Is it really needed? And is there a way to put a delay on the code level? I mean do something like this before the database request.
Thread.Sleep(milliseconds);

Execute Queries in sequence [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I have 5 queries
all are dependent on one by one
i have to run all queries in one time but it will be executed in sequence
it's possible..?
please help me
You can build a stored procedure and execute each query in desired order by placing the queries in corresponding execution order
you can use SSIS's sequence or process container to execute all of your SQL encapsulated in stored procedure at the same time, the provided screenshot show's processes in precedence, but you can also design them to execute at the same time.
Hope this helps.
Cheers!
Imagination is more important than knowledge

How to go about scraping and writing a script for an Oracle database [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
My manager has asked me to write a program that pulls data from a database that I have access to (it's an Oracle database and I'm using SQL developer). The idea is to get the data they want and put into an excel sheet in a way they would like. I haven't really wrote scripts before nor have I ever wrote a scraper, I was wondering what the first step is here and what resources I should use to get started? I have a couple of weeks to do this but I don't really know where to start.
I would start with an SQL query to find the data your manager wants. If you got the right result on screen, just right-click into the query result, select 'Export', and format= Excel...

SQL Server : create jobs [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to create a procedure which repeats itself several times. Let's say I want to change a character's position in a browser game for 3 minutes from one place to another. Its coordinates change constantly in the database. I need it to be dynamic so that I can use this code to move the character to more places in a different amount of time depending on the parameters passed to the procedure.
How can I do it?
Does jobs solve the problem? If so, how can I do it with jobs?
You could use the RAND() function to generate random coordinates, and a sql agent job to run the procedure throughout the day.
Since you mentioned that the coordinates change constantly in the database, you can have an update trigger that runs the stored procedure you have in mind instead of relying on a job. Let me know if you need more info on this.

Execute sql-statement once at date x [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to have an sql update-statement executed once at date x. How can I achieve this on an Oracle 10g database?
EDIT:
My aim is to fire an update statement every day. Why? I have a tiny mistake in my application, that can be 'temporarily fixed' with this statement (since I only have db-access till the real fix will happen).
Jonny
Consider DBMS_SCHEDULER. It is meant for running jobs periodically, but you can set up your pl/sql job script to suspend or cancel the job entry after your run-once job ends successfully.
http://docs.oracle.com/cd/B28359_01/server.111/b28310/scheduse.htm
You can use Crontab to schedule a task to be executed at given day/time.
See: http://en.wikipedia.org/wiki/Crontab