count without using count function

  • Hi all

    is there a way to retrieve records limiting based on some number but without using count function

    Thanks in advance

  • Checkout the SELECT statement's "TOP (X)" clause in Books Online.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Please don't double post.

    With that said, you can also use the

    SET ROWCOUNT XXX

    This affects the very next query in the process and will return the number of rows specified above. This is suppose to only work with Select statements. UPDATE, DELETE, and INSERT are being deprecated in 2008 last I read in BOL.

    I am not sure which is more efficeint though from a performance standpoint

    Fraggle.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply