Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

Cannot open Extended Event when default database not master

You might get an error message when looking at Extended Event data (file, etc) if Object Explorer isn't connected to the master database.

9 votes
Sign in
(thinking…)
Sign in with: oidc
Signed in as (Sign out)

We’ll send you updates on this idea

AdminMicrosoft SQL Server (Product Manager, Microsoft Azure) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: oidc
Signed in as (Sign out)
Submitting...
  • Karl Fasick commented  ·   ·  Flag as inappropriate

    Yes, even latest SSMS and SQL 2017 14.0.3030.27, can reproduce. I was reading Jess Borland's article http://blogs.lessthandot.com/index.php/datamgmt/dbprogramming/replacing-trace-flags-1204-and-1222-with-the-extended-events-system_health-session/ and hit this bug. Here's repro and fix: Note, it's not necessarily your login's default database that makes the difference - the hint is to the fix is in the description of this post - "Object Explorer isn't connected to the master database." To fix - disconnect Object Explorer - Reconnect, but go to Connection Properties and explicitly choose master to fix, or another to reproduce problem. Now drill into Management / Extended Events / Sessions / system_health / right click on package0.event_file - choose View Target Data. Either get the events or this error: TITLE: Microsoft SQL Server Management Studio
    ------------------------------

    The storage failed to initialize using the provided parameters. (Microsoft.SqlServer.XEventStorage)

    ------------------------------
    ADDITIONAL INFORMATION:

    Cannot view the function 'fn_MSXe_read_event_stream', because it does not exist or you do not have permission. (Microsoft SQL Server, Error: 15151)

Feedback and Knowledge Base