SQL Server Performance

Which one is faster

Discussion in 'General Developer Questions' started by anilsaritha, Oct 31, 2006.

  1. anilsaritha New Member

    Gurus

    Of the following two queries which one will execute faster

    Query 1

    SELECT NoOfShr,ShrAmt
    from CUS_tShrInstLdgrHdr
    WHEREBrID = @p_BrIDAnd
    PrdID=@p_PrdIDAnd
    AcctID=@p_AcctIDAnd
    Busndt>=dbo.fSetBusnDate(@m_FDate)And
    Busndt<=dbo.fSetBusnDate(@m_TDate)

    Query 2

    SELECT NoOfShr,ShrAmt
    from CUS_tShrInstLdgrHdr
    WHEREBrID = @p_BrIDAnd
    PrdID=@p_PrdIDAnd
    AcctID=@p_AcctIDAnd
    BusndtBetweendbo.fSetBusnDate(@m_FDate) dbo.fSetBusnDate(@m_TDate)


    Kindly assist

    Deep Regards
    Anil


    Never Give Up
  2. mmarovic Active Member

    They are equivalent, there is only minor syntax difference. It means between is internaly treated as <expression> <= <value from> and <expression> >= <value to>, so there will be no difference in execution plan.
  3. anilsaritha New Member

    Thanks Mirko For your reply

    Deep Regards
    Anil

    Never Give Up
  4. FrankKalis Moderator

Share This Page