I would like to use Django with MS-SQL server and the svn version
doesn't work yet.
I submitted a patch to make it work:
http://code.djangoproject.com/ticket/2358
It's not ideal, just a quick fix until I get a better understanding of
Django internals.
What is missing right now is LIMIT/OFFSET functionality.
In SQL 2005 there is a ROW_NUMBER function which would make the
implementation quite simple:
http://msdn2.microsoft.com/en-us/library/ms186734.aspx
For SQL 2000 however a more complicated SQL construct is necessary to
make it work.
I found an older patch for Django with an implementation:
http://code.djangoproject.com/ticket/225 but it doesn't seem to be
present in the code.
Is someone working on MS-SQL support?
I would like to help if possible with the implementation and testing.
Thank you,
Dan.
Yes, testing is the main thing that holds it. The patch was developed
sporadically and as far as I remember all the theoretical problems were
known how to solve. It's just needed someone to dedicate the time to
test it.
P.S. I'm not the one of the core devs so it makes sense anyway to wait
an answer from Jacob or Adrian.
Heads up: that file (django/db/models/query.py) is undergoing a bit of a
rewrite at the moment (as per [1]), so you may wish to hold off for a
little while until its done. Or maybe just keep charging ahead and
backport in the near future. Anyway, just letting you know in case you
hadn't noticed this.
Regards,
Malcolm
Since its so complicated for SQL 2000, couldn't you just cheat a bit
and do some in SQL and some in Python?
SELECT TOP limit+offset FROM table ...
and then in the backend:
return cursor.fetchall()[offset:]
(OK, I know its more complicated than that, but you get the idea).
That's typically the way I've seen paging done with SQL 2k in the past.
-Dave