bob laughland (pe*************@gmail.com) writes:
On Nov 19, 8:16*am, Erland Sommarskog <esq...@sommarskog.sewrote:
>This forum is devoted to SQL Server as such, and the only answer you will
get here, is that you are better off not using LINQ at all. :-)
Better off to not use LINQ at all? Why do you say that?
Is that because people in this group are a bit biased?
I did have a smiley in there. :-) But, yes, there may be some bias here.
Anyway I must admit LINQ has not been everything it is cracked up to
be so far. I have had some issues with it, and wonder whether I should
completely remove LINQ.
I guess LINQ has some advantage, as you don't run the risk of getting
SQL syntax errors at run-time. Then again, you can use stored procedures...
Ideally, using LINQ should not be an issue. SQL is a declarative language,
and if LINQ generates SQL, it's also declarative. So you declare your
intent, and the optimizer figures out how to do it. In practice, though,
you may need to tweak the query a little bit, and if nothing else add a
hint. Which I guess is somewhat difficult to do in LINQ. I also suspect
that LINQ does not support all you can do in SQL. This means if you need
to do something more complex, you are back to the object-relational
impedance mismatch.
--
Erland Sommarskog, SQL Server MVP,
es****@sommarskog.se
Links for SQL Server Books Online:
SQL 2008:
http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005:
http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:
http://www.microsoft.com/sql/prodinf...ons/books.mspx