473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to make a SQL run longer?

Raj
Hell All,
To reproduce one of our cusotmer's probem, I need to make the SQL to
run for more than a minutes before it returns the result set. I do not
have large amount of data in the database to simulate the dealy.

Is there a way in SQL to cause the delay while returning the result
set

Thanks for the help.

Regards
Raj

Jun 27 '07 #1
7 1607
WAITFOR will do that.

select getdate()
waitfor delay '00:01:00'
select getdate()

Roy Harvey
Beacon Falls, CT

On Wed, 27 Jun 2007 11:16:26 -0700, Raj <jk******@gmail.comwrote:
>Hell All,
To reproduce one of our cusotmer's probem, I need to make the SQL to
run for more than a minutes before it returns the result set. I do not
have large amount of data in the database to simulate the dealy.

Is there a way in SQL to cause the delay while returning the result
set

Thanks for the help.

Regards
Raj
Jun 27 '07 #2
Raj
On Jun 27, 11:56 am, Roy Harvey <roy_har...@snet.netwrote:
WAITFOR will do that.

select getdate()
waitfor delay '00:01:00'
select getdate()

Roy Harvey
Beacon Falls, CT

On Wed, 27 Jun 2007 11:16:26 -0700, Raj <jkama...@gmail.comwrote:
Hell All,
To reproduce one of our cusotmer's probem, I need to make the SQL to
run for more than a minutes before it returns the result set. I do not
have large amount of data in the database to simulate the dealy.
Is there a way in SQL to cause the delay while returning the result
set
Thanks for the help.
Regards
Raj- Hide quoted text -

- Show quoted text -
Thanks for replying. My challange is that I can pass only one SQL
statement at at time. Is there a function that I use like this:

select a, b, c
from table_a a, table_b where a.cid = b.cid and delay(0:0:1)

Thanks.
Raj

Jun 27 '07 #3
On Wed, 27 Jun 2007 12:47:14 -0700, Raj <jk******@gmail.comwrote:
>Thanks for replying. My challange is that I can pass only one SQL
statement at at time. Is there a function that I use like this:

select a, b, c
from table_a a, table_b where a.cid = b.cid and delay(0:0:1)
No, there is no such thing that I know of.

Roy Harvey
Beacon Falls, CT
Jun 27 '07 #4

"Raj" <jk******@gmail.comschreef in bericht
news:11**********************@k29g2000hsd.googlegr oups.com...
Hell All,
To reproduce one of our cusotmer's probem, I need to make the SQL to
run for more than a minutes before it returns the result set. I do not
have large amount of data in the database to simulate the dealy.

Is there a way in SQL to cause the delay while returning the result
set

Thanks for the help.

Regards
Raj
maybe you should tell us WHY you need a delay, because most in the eyes of
most people a SQL-server must be fast, so no DELAY's....

I hink when you do give that information, there might be another way to
solve your problem.

regards,
Luuk
Jun 27 '07 #5
Raj (jk******@gmail.com) writes:
Thanks for replying. My challange is that I can pass only one SQL
statement at at time.
Huh? What environment is this?
Is there a function that I use like this:

select a, b, c
from table_a a, table_b where a.cid = b.cid and delay(0:0:1)
You could write one that calls xp_cmdshell and the uses a wait command
in the shell.

But hopefullly you can also access the database from a regular query
window. In such case you can start a transaction that locks one of the
tables in your query. After a minute you commit/rollback that transaction,
so that the other process is let go.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jun 27 '07 #6
Raj
On Jun 27, 2:33 pm, Erland Sommarskog <esq...@sommarskog.sewrote:
Raj (jkama...@gmail.com) writes:
Thanks for replying. My challange is that I can pass only one SQL
statement at at time.

Huh? What environment is this?
Is there a function that I use like this:
select a, b, c
from table_a a, table_b where a.cid = b.cid and delay(0:0:1)

You could write one that calls xp_cmdshell and the uses a wait command
in the shell.

But hopefullly you can also access the database from a regular query
window. In such case you can start a transaction that locks one of the
tables in your query. After a minute you commit/rollback that transaction,
so that the other process is let go.

--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Thank you. I will try this and then update the thread.

Jun 27 '07 #7
Raj
On Jun 27, 1:05 pm, "Luuk" <l...@invalid.lanwrote:
"Raj" <jkama...@gmail.comschreef in berichtnews:11**********************@k29g2000hsd.g ooglegroups.com...
Hell All,
To reproduce one of our cusotmer's probem, I need to make the SQL to
run for more than a minutes before it returns the result set. I do not
have large amount of data in the database to simulate the dealy.
Is there a way in SQL to cause the delay while returning the result
set
Thanks for the help.
Regards
Raj

maybe you should tell us WHY you need a delay, because most in the eyes of
most people a SQL-server must be fast, so no DELAY's....

I hink when you do give that information, there might be another way to
solve your problem.

regards,
Luuk
Our is an reporting application that can connect to either SQL server
or Oracle, retrieve the data and prsent the data over the web for the
end users. This application has the option to preview the data while
developing the report. Duing the preview, if the query takes more
than
one minute than our application hangs.

I need to reproduce this behaviour but unfortunately does not have
enough
data in my database to create the one minute.

Thanks.
Raj
Jun 27 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Lowell Kirsh | last post by:
I have a script which I use to find all duplicates of files within a given directory and all its subdirectories. It seems like it's longer than it needs to be but I can't figure out how to shorten...
7
by: Irish | last post by:
Hello all :) Hopefully someone can shed some light on this problem I'm having. I'm trying to declare a variable to a type of class I've defined (which is a minHeap), but actually instantiate it...
7
by: rednexgfx_k | last post by:
All, Problem Summary: I've running about 30 make table queries via VBA in Access 2000, and my database goes from 14,000k to over 2,000,000k. In addition, the longer the procedure runs, the...
1
by: Huey | last post by:
Hi All, I encountered a funny thing, and my code schetch as below: #define READ 0 #define WRITE 1 int byteRead, status, pd; char buff;
8
by: **Developer** | last post by:
I'd like to make sure a string is no longer that some value. What is the best way to do that. For example, it would be nice if I could do: ControlComboBoxName.Text = name.Substring(0,...
28
by: Steven Bethard | last post by:
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions!...
0
by: b.coolsaet | last post by:
Hi, like the title says simplexml is giving me a "Node no longer exists" error while using the addChild() function. Note that it's not giving an error on the first addChild(); Can somebody...
4
by: karen987 | last post by:
I have a column in a table, which draws out info from a database. The column is 150px wide. I want it to remain this wide, even if one word is longer. What happens now is that if i put in a web...
82
by: Bill David | last post by:
SUBJECT: How to make this program more efficient? In my program, a thread will check update from server periodically and generate a stl::map for other part of this program to read data from....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.