Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using Entity Framework 4 with stored procedures and SQL Server 2008 SP1... When running SQL Server Profiler (TSQL_SPs template), the lines that show my stored procedure call and its statements say that they executed in DatabaseID = 1 (Master) but it is actually happening in my application database (ID = 8). The procedures execute properly and return the data, and they only exist in my application database, so why does Profiler mark those lines as being in Master? Is this a bug in Profiler? Is it a bug in EF4?

Note that running the same code against a SQL 2000 instance, Profiler correctly shows the application's database ID.

UPDATE: I have now tested this on a new installation of SQL Server 2008 R2 and it still displays this as if it happened in Master.

UPDATE 2: This has been logged to Connect at

share|improve this question
up vote 0 down vote accepted

Learned a work-around from Olaf Tinnemeyer on StackOverflow: Changing the MultipleActiveResultSets option in the Connection String to FALSE causes Profiler to properly report the query as being executed in the application database.

I still think this is a bug in SQL 2008, but I can live with the work-around for now.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.