Forum Replies Created

Viewing 12 posts - 16 through 27 (of 27 total)

  • RE: Checking numerical distance between rows

    For those not having Yukon, etc I wrote this query.

    The query tells you if the person has the 8 accounting periods required and that the distances between the periods...

  • RE: Sum in Exists Clause

    Here is another solution involving just joins

    select h.headerid,h.[sum]

    from header h

    inner join

     (select distinct b.headerid as bHID, b.item as bItem

     from detail b

     inner join

     (select a.hid, count(*) as ItemsSold

     from (select...

  • RE: Need Fast ''''Contains'''' Search!

    Very good question.

    I would venture to say, that the answer to this question is not a piece of sql code. However, maybe somebody will know rightout of SQL text...

  • RE: How would I do this join?

    Here is another way probably a little faster, using a function

    select Name, dbo.PosTitle(fkfirstChoice), dbo.PosTitle(fkSecondChoice)

    from JobApplicants

    create function dbo.PosTitle(@Choice int)

    returns varchar(50)

    AS

    Begin

    declare @Title varchar(50)

     Select @Title = PositionTitle from OpenPosition where pkPositionID=@Choice...

  • RE: Finding gaps in ranges...how?

    It seems that the question was to obtain the product key in the first gap. hence, we need a function that returns such value. I took Phil's answer and re-wrote it...

  • RE: SQL Server Bug or Limit or Something else

    Two comments on Kenneth reply:

    Kenneth said that he is not surprised to see that the beast is taking its toll on server resources. My question however, is why query :...

  • RE: Looping over records without a Cursor?

    I think that under some conditions the number of rows to be updated should weigh into the decision to use memory tables.

    I agree that if the table size is...

  • RE: SQL Server Bug or Limit or Something else

    A quick update  on this issue.

    Good news!!!. I let the query run for as long as it needed. It did complete after 16 minutes.  The final stats are shown...

  • RE: SQL Server Bug or Limit or Something else

    AngelaBut hasked if I had updated the table statistics.

    Yes, I did run the update stats for all the base tables but the query still hangs.

    I let it run...

  • RE: Tough Query

    It seems that there is an easy solution.

    The idea is to use induction as follows: if I know when two dates are contiguos then I should apply that query...

  • RE: SQL Server Bug or Limit or Something else

    Antares686 suggested that I post the showplan. Attached in the showplan for the query with the search condition on. (the one that hangs)

     

     

    StmtText                       StmtId      NodeId      Parent      PhysicalOp                     LogicalOp                      Argument DefinedValues...

  • RE: Which IDE?

    I have been playing with RS recently and I can tell you that to get the designer you have to install RS client portion into an existing VS.NET IDE. The...

Viewing 12 posts - 16 through 27 (of 27 total)