Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. MSSQL 2005 and row_count()

MSSQL 2005 and row_count()

Scheduled Pinned Locked Moved Database
databasemysqlsql-serverquestionannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alex barylski
    wrote on last edited by
    #1

    I am currently working in a MSSQL 2000 version and all of the paginated results for various scripts are done using 3 or more SELECT sub-queries. Unlike MySQL which only requires a single query --- I cannot see this being very efficient, especially the larger your database grows? I have done some googling and it turns out that row_count() is MSSQL answer since 2005 -- can anyone confirm whether this is the case and better yet refer me to some resources which I can read over the weekend to freshen up on MSSQL? Cheers, Alex

    K 1 Reply Last reply
    0
    • A alex barylski

      I am currently working in a MSSQL 2000 version and all of the paginated results for various scripts are done using 3 or more SELECT sub-queries. Unlike MySQL which only requires a single query --- I cannot see this being very efficient, especially the larger your database grows? I have done some googling and it turns out that row_count() is MSSQL answer since 2005 -- can anyone confirm whether this is the case and better yet refer me to some resources which I can read over the weekend to freshen up on MSSQL? Cheers, Alex

      K Offline
      K Offline
      kriskomar
      wrote on last edited by
      #2

      Correct, ROW_COUNT() is a very efficient way to get a row count in SQL 2005.

      A 1 Reply Last reply
      0
      • K kriskomar

        Correct, ROW_COUNT() is a very efficient way to get a row count in SQL 2005.

        A Offline
        A Offline
        alex barylski
        wrote on last edited by
        #3

        Do you happen to know of any benchmarks that compare the old style to the new?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups