Improve LINQ to SQL performance
While it is easy to get carried away with using LINQ to SQL, developers have the responsibility to understand what is going on under the hood and to ensure that things are running as smoothly and efficiently as possible.
The following blog post describes 10 tips from improving LINQ to SQL performance, highly recommended for anyone using LINQ to SQL.
January 2008 release of SQL Server 2005 Best Practices Analyzer
Microsoft has released a new version of the SQL Server 2005 Best Practices Analyzer tool. The tool is from a Database Administrator’s (DBA) perspective and not from an architect nor developer’s perspective.
Check it out here:
Entity Framework FAQ
With LINQ become more predominate every day, eventually some important will be asked as developers need to adopt new and different ways of accessing data repositories.
I recently came across a great (and detailed) FAQ that is sure to answer most questions.
http://blogs.msdn.com/dsimmons/pages/entity-framework-faq.aspx
I certainly answered my question, but not with the answer I was hoping for :(. Automatic mapping between Enums and a column in a table is not supported.
http://blogs.msdn.com/dsimmons/pages/entity-framework-faq.aspx#_Does_the_EDM/EF
I hope they rethink this as that kind of simplicity is what increases adoption of new technologies. It’s one the things that convinced me to start using NHibernate. Even LINQ to SQL supports automatic enum mapping.
Free Database Compare
I recently came across an interesting looking program by StarInix called Free Database Compare 2.0. The great thing is that is support Microsoft SQL Server and MySQL.
Getting Windows to Search within .SQL files
With Windows XP the default behaviour for searching within files will ignore .SQL files.
To get around this you can add a registry setting which will force Windows to treat .SQL files as text so it can search within the file.
- Open regedit
- Go to HKEY_CLASSES_ROOT\.sql
- Add a new key PersistentHandler
- Set the default value for the key to {5e941d80-bf96-11cd-b579-08002b30bfeb}
That’s it. You can do this for any other file type as well.
Perry
SQL Snippet for Paging
Microsoft SQL 2005 finally introduced better support for doing paging at the database level. I’m a little disappointed that MS is not pushing to use this as the default method for paging, instead of relying on ASP.NET controls.
1 USE AdventureWorks 2 GO 3 4 SELECT * FROM ( 5 SELECT 6 ROW_NUMBER() OVER (ORDER BY SellStartDate ASC) AS rownumber,* 7 FROM Production.Product 8 ) AS Product 9 WHERE rownumber between @FromRow AND @ToRow