Sql-server – Change Name of Extended Event Session

extended-eventssql server

I've just recently started working with Extended Events and am loving it. However, I ran into a small annoyance and am wondering if there's a way around it.

I had a very simple ExEvent session that was named "DatabaseFooActivity". Once I got comfortable with that, I expanded it so it was looking at more than just Database "Foo", meaning that the session name is no longer accurate. Now, when I right-click the session, there's no rename option and when I go into it's properties, the Session Name field is grayed out.

In short, can you change the name of an Extended Event session after it's been created, without dropping and recreating it?

Best Answer

No, there is no way to rename an Extended Events session without dropping and recreating it. The NAME property is not part of the ALTER EVENT SESSION syntax, nor is it supported by sp_rename. Simply use SSMS to script and recreate the session easily. You don't lose anything by doing this.