Re: How to make a SQL run longer?



On Jun 27, 2:33 pm, Erland Sommarskog <esq...@xxxxxxxxxxxxx> wrote:
Raj (jkama...@xxxxxxxxx) 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...@xxxxxxxxxxxxx

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.

.



Relevant Pages

  • Re: How to make a SQL run longer?
    ... But hopefullly you can also access the database from a regular query ... In such case you can start a transaction that locks one of the ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Millions of Delete Statements
    ... lose the ability to know which statement within the transaction failed ... (i.e., the row wasn't there, which is information I need to capture). ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: non key select or search
    ... I need to match the above to a transaction so i can report to the entity ... INSERT statements with sample data. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Different result WITH or WITHOUT using Transaction in SQL Server Stored Procedure
    ... SQL Server Stored Procedure even if I only remove transaction. ... Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books ... ... Table involve in update is having a column qty which is based on some ...
    (comp.databases.ms-sqlserver)
  • Re: begin and end transaction and transaction log
    ... recovery, SQL Server will regularly truncate the transaction log, and thus ... Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books ... ...
    (comp.databases.ms-sqlserver)