Robin Hames

Hints, tricks and tips relating to MS SQL Server and .NET
posts - 14 , comments - 45 , trackbacks - 0


Microsoft ADO.NET technologies
Why you should always specify the SqlDbType for an ADO.NET SqlParameter object.
How not specifying the ADO.NET SqlParameter DbType can lead to a horrible query execution plan! I was looking into a query that was performing much worse than expected. The query was a simple select of the form: select e.EmployeeID, count(r.EmployeeRoleID) from Employee e left join EmployeeRole r on e.EmployeeID = r.EmployeeID where e.EmployeeRef = @EmployeeRef group by e.EmployeeID I expected the query plan for this to be fairly straightforward, a couple of Index Seeks and a Left Outer Join, but ......

Posted On Wednesday, October 29, 2008 3:50 PM | Comments (2) |

Powered by: