Showing posts with label returns. Show all posts
Showing posts with label returns. Show all posts

Friday, March 23, 2012

How to make a SQL run longer?

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
RajWAITFOR 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 <jkamaraj@.gmail.comwrote:

Quote:

Originally Posted by

>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

|||On Jun 27, 11:56 am, Roy Harvey <roy_har...@.snet.netwrote:

Quote:

Originally Posted by

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:

Quote:

Originally Posted by

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.


>

Quote:

Originally Posted by

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


>

Quote:

Originally Posted by

Thanks for the help.


>

Quote:

Originally Posted by

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|||On Wed, 27 Jun 2007 12:47:14 -0700, Raj <jkamaraj@.gmail.comwrote:

Quote:

Originally Posted by

>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|||"Raj" <jkamaraj@.gmail.comschreef in bericht
news:1182968186.181731.177720@.k29g2000hsd.googlegr oups.com...

Quote:

Originally Posted by

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|||Raj (jkamaraj@.gmail.com) writes:

Quote:

Originally Posted by

Thanks for replying. My challange is that I can pass only one SQL
statement at at time.


Huh? What environment is this?

Quote:

Originally Posted by

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, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||On Jun 27, 2:33 pm, Erland Sommarskog <esq...@.sommarskog.sewrote:

Quote:

Originally Posted by

Raj (jkama...@.gmail.com) writes:

Quote:

Originally Posted by

Thanks for replying. My challange is that I can pass only one SQL
statement at at time.


>
Huh? What environment is this?
>

Quote:

Originally Posted by

Is there a function that I use like this:


>

Quote:

Originally Posted by

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.|||On Jun 27, 1:05 pm, "Luuk" <l...@.invalid.lanwrote:

Quote:

Originally Posted by

"Raj" <jkama...@.gmail.comschreef in berichtnews:1182968186.181731.177720@.k29g2000hsd.g ooglegroups.com...
>

Quote:

Originally Posted by

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.


>

Quote:

Originally Posted by

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


>

Quote:

Originally Posted by

Thanks for the help.


>

Quote:

Originally Posted by

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

Friday, March 9, 2012

How to link datasets for reporting?

I have 2 datasets for a single report. One dataset(1) returns value(s), the
second dataset(2) has many records for each value(s) of dataset(1). Yes, one
to many. On the report I wish to display a result of dataset(1) with a
wrapping text box with the many values of dataset(2), then pagebreak and page
two will be the next result of dataset(1) with the many records of dataset(2)
in a wrapbox etc... I have a key column in both datasets. I need to first
figure out how to link them and use the data on report as I described. thanks
!!Read up on subreports. That is how to solve this problem.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"T" <T@.discussions.microsoft.com> wrote in message
news:5722C5FE-4DD1-4FAA-ACF8-86FCA2B15ACA@.microsoft.com...
>I have 2 datasets for a single report. One dataset(1) returns value(s),
>the
> second dataset(2) has many records for each value(s) of dataset(1). Yes,
> one
> to many. On the report I wish to display a result of dataset(1) with a
> wrapping text box with the many values of dataset(2), then pagebreak and
> page
> two will be the next result of dataset(1) with the many records of
> dataset(2)
> in a wrapbox etc... I have a key column in both datasets. I need to
> first
> figure out how to link them and use the data on report as I described.
> thanks
> !!|||I have come across similar scenarios and tried to solved it with two
datasets, but each time I come back to include alla data in one "flat"
dataset and use gropuing instead.
Ex. If you have one dataset with adresses and one dataset with related phone
numbers. Like:
Adress
1, "MyStreet", "MyCity"
2, "MySecondStreet", "MyCity"
Phone
1, 1, "Phone", "+46-123456"
2, 1, "Fax", "+46-8-232323"
3, 2, "Phone", "+46-654321"
4, 2, "Fax", "+46-8-44444"
Then join them into one dataset instead of two, like:
1, "MyStreet", "MyCity", 1, 1, "Phone", "+46-123456"
1, "MyStreet", "MyCity", 2, 1, "Fax", "+46-8-232323"
2, "MySecondStreet", "MyCity", 3, 2, "Phone", "+46-654321"
2, "MySecondStreet", "MyCity", 4, 2, "Fax", "+46-8-44444"
Create a new Report using this Dataset.
Set property "HideDuplicates = true" on the Adress columns.
Create a group with "AddressId" as group value, if you like to SUM some
values one on "adress-level"
This way you "simulate" related datasets.
Regards Martin Bring
**********************
"T" wrote:
> I have 2 datasets for a single report. One dataset(1) returns value(s), the
> second dataset(2) has many records for each value(s) of dataset(1). Yes, one
> to many. On the report I wish to display a result of dataset(1) with a
> wrapping text box with the many values of dataset(2), then pagebreak and page
> two will be the next result of dataset(1) with the many records of dataset(2)
> in a wrapbox etc... I have a key column in both datasets. I need to first
> figure out how to link them and use the data on report as I described. thanks
> !!