CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #3
    Join Date
    May 2004
    Location
    London, England
    Posts
    563

    Re: Query Analyzer....

    The Query is as follows :

    Code:
    Insert into TableName
    select T.ID, T.RecordType, T.Status, T.Available
    from (TableName T inner join Selection S on S.selectionID = T.ID)
                                  inner join Assessement A on S.EventID= A.ID
    where A.highlighted = @InputParameter
    The above query works as expected as it returns the number of rows as expected for a given @InputParameter

    However, the following SQL is where the problem lies:

    Code:
    select count(*) Select_Count from TableName
    where RecordType = 'T' and Status='C' and Available = 0
    All the above SQL is wrapped up into a stored procedure and is called within my application.
    But the last SQL select statement above times out after 30 seconds in my app, but in the Query analyzer it continues to be executed for as long as 10 minutes. There is no reason as to why it keeps on executing or timing out as the rows returned maybe 0 or 1000 (max) at any given time.

    In the Profiler, *sometimes* it will state that the last SQL has completed, but in the Query Analyzer it will be shown that its still executing.

    I think it may prove tto be helpful that these two SQL procedures are run when there is alot of traffick on the database server network.
    Any explanations?
    Last edited by Vaderman; July 14th, 2006 at 06:31 AM. Reason: additional relevant information
    I don't mind that you think slowly but I do mind that you are publishing faster than you think. Wolfgang Pauli, physicist, Nobel laureate (1900-1958)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured