Welcome Guest, Not a member yet? Register   Sign In
Active record, offset limit with mssql
#11

[eluser]gigas10[/eluser]
Its because theoretically the limit function from mysql is the same as the top function from mssql, (there is no limit in mssql, its top and its called when you select which columns you want). However, MSSQL does not support offset. You would have to do the pagination stuff out manually, it can be done it's just a pain to do it. Theres not much else you can do, as MSSQL is horrible IMO. Good luck sir.

-PS-

I know how your stuck with it, I too am stuck with MSSQL and IIS 6.0 at work, and its a shame. They won't even install the module on the server that allows IIS to do module rewrites, so I'm stuck using index.php/controller/function instead of /controller/function :-( . The other thing that bugs the crap out of me about MSSQL is the fact that I have to use the 2000 edition, and when you select all rows from a table with the browser, it does not tell you how many rows it finds.... it takes all day to scroll to the bottom.... and after about 1 minute, they have the server set so I lose all my data and have to refetch it.
#12

[eluser]Leandro AR[/eluser]
My name is Leandro, from Buenos Aires, Argentina.
I'm development a application in: CI 1.7.1, PHP 5.2.6 and SQL Server 2005.

The pagination, for now, it's impossible, but in other frameworks like Symphony, it's possible.

I tried the solution using a ROW_NUMBER(), for example:

Code:
SELECT *
      FROM
          ( SELECT *, ROW_NUMBER() OVER (ORDER BY id) as NroFila

            FROM  $tableXXX

           ) AS PAG_TABLEXXX

      WHERE
      NroFila BETWEEN 10 AND 20

Now, how adapted this code to mssql_driver.php -> function _limit($sql, $limit, $offset) ?

In the sql server 2005, the solution could be using ROW_COUNT(), ROW_NUMBER ...

Together we must find a solution to this problem.

Thanks,
Leandro.




Theme © iAndrew 2016 - Forum software by © MyBB