Running SQL Server 2008 Profiler to watch the activity of a ASP.NET WebForms application that uses Entity Framework 4...The profiler output lines for the queries indicate that they are occurring in Database ID = 1 / Database Name = Master, but the queries are actually occuring in the application database, not Master.
It does not matter whether the queries are straight LINQ-to-Entities or are EF Functions that call a stored procedure. Also the login's default database is NOT master, so that is not the problem.
This bug is evident in SQL 2008 SP1 and SQL 2008 R2 RTM. However, when the database is running on a SQL 2000 SP3a instance, Profiler reports the correct database.