views:

994

answers:

2

Can SQL Server 2000 be used as the database for LINQ to SQL?

Does LINQ to SQL rely on a specific version of Microsoft SQL Server?

+3  A: 

Yes, you can.

LINQ to SQL adapts the generated queries to work with 2000.

Mehrdad Afshari
I'd be happy to know the reason for downvote!
Mehrdad Afshari
Me too...the answer was basically correct so I upvoted you to get rid of the downvote.
Mark Brittingham
+8  A: 

Yes, LINQ to SQL works with SQL Sever 2000 with one exception: you do need the ROW_NUMBER() function, available only in SQL Server 2005/2008, to support efficient server-side paging. Without it, paging functions (as Mehrdad points out) are delivered using the classic Top N strategy - very inefficient as you page further and further through your dataset because you end up throwing out most of your selected records from the third page on.

Mark Brittingham
It is also available in 2000 but it is less efficient. LINQ to SQL uses a nested SELECT TOP n statement for that case instead.
Mehrdad Afshari
Hi Mehrdad - good tip but you are right, that grows very inefficient very quickly as you page through the dataset!
Mark Brittingham
I've updated my answer to reflect your comments.
Mark Brittingham
But it's still much better than paging on the client side.
Mehrdad Afshari