{"id":997,"date":"2019-03-21T06:00:49","date_gmt":"2019-03-21T13:00:49","guid":{"rendered":"http:\/\/3.209.169.194\/blogs\/erin\/?p=997"},"modified":"2019-03-20T15:30:45","modified_gmt":"2019-03-20T22:30:45","slug":"extended-events-in-azure-data-studio","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/","title":{"rendered":"Extended Events in Azure Data Studio"},"content":{"rendered":"<p>I was prompted to dig into using Extended Events in Azure Data Studio (ADS) after the latest release came out from the Tools Team this past Monday.\u00a0 After you <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/azure-data-studio\/download?view=sql-server-2017\">download<\/a> and install ADS, and <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/azure-data-studio\/quickstart-sql-server?view=sql-server-2017\">connect to an instance<\/a>, you&#8217;ll want to navigate to the Extension Manager (blue box in image), then scroll through the list to find SQL Server Profiler (purple box in image):<\/p>\n<p><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/1_ADS.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-large wp-image-998\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/1_ADS-1024x583.jpg\" alt=\"Azure Data Studio Extension Manager\" width=\"1024\" height=\"583\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/1_ADS-1024x583.jpg 1024w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/1_ADS-300x171.jpg 300w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/1_ADS-900x513.jpg 900w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/1_ADS.jpg 1638w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>Azure Data Studio Extension Manager<\/p>\n<p>&nbsp;<\/p>\n<p><strong>NOTE:<\/strong> Even though the extension is named SQL Server Profiler, <em>it is using Extended Events<\/em>.\u00a0 The documentation states explicitly:<\/p>\n<blockquote><p>&#8220;The SQL Server Profiler extension provides a simple SQL Server tracing solution similar to SSMS Profiler except built using XEvents.&#8221;<\/p><\/blockquote>\n<p>To clarify, the extension in ADS is like <a href=\"https:\/\/sqlperformance.com\/2019\/02\/extended-events\/capture-queries-sql-server\">XEvent Profiler in Management Studio<\/a> (which also is built using Extended Events).\u00a0 The name &#8220;SQL Server Profiler&#8221; is confusing, as this is not the same tool (UI) that&#8217;s been available since SQL Server 7.0.<\/p>\n<p>To install the extension, click on it, and then select Install.\u00a0 Once it&#8217;s installed you can select Reload and it will move into the top half of the window under Enabled.\u00a0 Notice that when you select the extension, information about how to use it also appears.<\/p>\n<figure id=\"attachment_999\" aria-describedby=\"caption-attachment-999\" style=\"width: 1024px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/2_Extension.jpg\"><img decoding=\"async\" class=\"size-large wp-image-999\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/2_Extension-1024x656.jpg\" alt=\"SQL Server Profiler Extension Installed\" width=\"1024\" height=\"656\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/2_Extension-1024x656.jpg 1024w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/2_Extension-300x192.jpg 300w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/2_Extension-900x577.jpg 900w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/2_Extension.jpg 1564w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-999\" class=\"wp-caption-text\">SQL Server Profiler Extension Installed<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>The easiest way to start using Extended Events in ADS is to use Alt+P (for Windows) or Ctrl+Alt+P (for macOS). You can also click on the Manage icon in the bottom left, select Command Palette&#8230; and then type Profiler. Using either method, you&#8217;ll get a Connection window to connect to the instance:<\/p>\n<figure id=\"attachment_1000\" aria-describedby=\"caption-attachment-1000\" style=\"width: 624px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/3_connection.jpg\"><img decoding=\"async\" class=\"size-full wp-image-1000\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/3_connection.jpg\" alt=\"Connection panel\" width=\"624\" height=\"513\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/3_connection.jpg 624w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/3_connection-300x247.jpg 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/a><figcaption id=\"caption-attachment-1000\" class=\"wp-caption-text\">Connection panel<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Once you&#8217;ve connected, you&#8217;ll be prompted to select what type of session to create, and there are three options currently available:<\/p>\n<figure id=\"attachment_1001\" aria-describedby=\"caption-attachment-1001\" style=\"width: 613px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/4_newsession.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1001\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/4_newsession.jpg\" alt=\"XE New Session\" width=\"613\" height=\"289\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/4_newsession.jpg 613w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/4_newsession-300x141.jpg 300w\" sizes=\"(max-width: 613px) 100vw, 613px\" \/><\/a><figcaption id=\"caption-attachment-1001\" class=\"wp-caption-text\">XE New Session<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>This is where things get interesting.<\/p>\n<p>There are three template options:<\/p>\n<ul>\n<li>Standard_OnPrem<\/li>\n<li>Standard_Azure<\/li>\n<li>TSQL_OnPrem<\/li>\n<\/ul>\n<p>Within XEvent Profiler in SSMS there are only two options:<\/p>\n<ul>\n<li>Standard<\/li>\n<li>TSQL<\/li>\n<\/ul>\n<p>The events in the Standard_OnPrem and Standard event sessions are the same.\u00a0 The events in the TSQL_OnPrem and TSQL event sessions are the same.\u00a0 The Standard_Azure event session cannot be created for an on-premises installation &#8211; it will silently fail.<\/p>\n<p>Once you select the session you want and select Start, a new window opens which is like the Live Data Viewer in SSMS, but with options.\u00a0 As queries are executing, they will start to appear in the window.\u00a0 When you have found the information you need, you can stop the event session using the stop button (red box in image, along with Start and Pause) or you can close the window.\u00a0 If you close the window you will be prompted to stop the event session, which I would recommend doing.\u00a0 You can also change the view using the Select View drop down (blue box in image), which changes which columns appear in the window.\u00a0 Lastly, when you have stopped an event session, you can select a different event session which already exists on the instance from the Select Session drop down (purple box in image) and start it from the window.<\/p>\n<figure id=\"attachment_1002\" aria-describedby=\"caption-attachment-1002\" style=\"width: 1024px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/5_session-options.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-1002\" src=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/5_session-options-1024x328.jpg\" alt=\"Session options\" width=\"1024\" height=\"328\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/5_session-options-1024x328.jpg 1024w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/5_session-options-300x96.jpg 300w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/5_session-options-900x288.jpg 900w, https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/5_session-options.jpg 1609w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-1002\" class=\"wp-caption-text\">Session options<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>A few things worth noting:<\/p>\n<ul>\n<li>The Event Sessions created in ADS write to the ring_buffer target, the ones created in SSMS do not write to any target.<\/li>\n<li>If you have an event session running:\n<ul>\n<li>Closing the Profiler window in ADS <strong>does<\/strong> prompt you to stop the event session.<\/li>\n<li>Closing ADS entirely <strong>does not<\/strong> prompt you to stop the event session.<\/li>\n<\/ul>\n<\/li>\n<li>You can create the TSQL and Standard event sessions in SSMS, and you can create the Standard_OnPrem and TSQL_OnPrem event sessions in ADS, and theoretically run all of them at the same time.\u00a0 I wouldn&#8217;t recommend this, but if you have multiple users, be aware it&#8217;s possible.<\/li>\n<li>To see what event sessions are running, you can execute:<\/li>\n<\/ul>\n<p style=\"padding-left: 60px;\">SELECT *<br \/>\nFROM sys.dm_xe_sessions;<br \/>\nGO<\/p>\n<ul>\n<li>To stop an event session using T-SQL, you can execute:<\/li>\n<\/ul>\n<p style=\"padding-left: 60px;\">ALTER EVENT SESSION ADS_Standard_OnPremES<br \/>\nON SERVER<br \/>\nSTATE = STOP;<br \/>\nGO<\/p>\n<ul>\n<li>You can still create, alter, and stop event sessions using T-SQL in Azure Data Studio.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I was prompted to dig into using Extended Events in Azure Data Studio (ADS) after the latest release came out from the Tools Team this past Monday.\u00a0 After you download and install ADS, and connect to an instance, you&#8217;ll want to navigate to the Extension Manager (blue box in image), then scroll through the list [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Extended Events in Azure Data Studio - Erin Stellato<\/title>\n<meta name=\"description\" content=\"Extended Events in Azure Data Studio can be started via an extension,and gives the similar functionality as what you see in XEvents Profiler in SSMS.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Extended Events in Azure Data Studio - Erin Stellato\" \/>\n<meta property=\"og:description\" content=\"Extended Events in Azure Data Studio can be started via an extension,and gives the similar functionality as what you see in XEvents Profiler in SSMS.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/\" \/>\n<meta property=\"og:site_name\" content=\"Erin Stellato\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-21T13:00:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-20T22:30:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/1_ADS-1024x583.jpg\" \/>\n<meta name=\"author\" content=\"Erin Stellato\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Erin Stellato\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/\",\"name\":\"Extended Events in Azure Data Studio - Erin Stellato\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#website\"},\"datePublished\":\"2019-03-21T13:00:49+00:00\",\"dateModified\":\"2019-03-20T22:30:45+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158\"},\"description\":\"Extended Events in Azure Data Studio can be started via an extension,and gives the similar functionality as what you see in XEvents Profiler in SSMS.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Extended Events in Azure Data Studio\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/\",\"name\":\"Erin Stellato\",\"description\":\"The SQL Sequel\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158\",\"name\":\"Erin Stellato\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g\",\"caption\":\"Erin Stellato\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/erin\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/author\/erin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Extended Events in Azure Data Studio - Erin Stellato","description":"Extended Events in Azure Data Studio can be started via an extension,and gives the similar functionality as what you see in XEvents Profiler in SSMS.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/","og_locale":"en_US","og_type":"article","og_title":"Extended Events in Azure Data Studio - Erin Stellato","og_description":"Extended Events in Azure Data Studio can be started via an extension,and gives the similar functionality as what you see in XEvents Profiler in SSMS.","og_url":"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/","og_site_name":"Erin Stellato","article_published_time":"2019-03-21T13:00:49+00:00","article_modified_time":"2019-03-20T22:30:45+00:00","og_image":[{"url":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-content\/uploads\/2019\/03\/1_ADS-1024x583.jpg"}],"author":"Erin Stellato","twitter_misc":{"Written by":"Erin Stellato","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/","url":"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/","name":"Extended Events in Azure Data Studio - Erin Stellato","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#website"},"datePublished":"2019-03-21T13:00:49+00:00","dateModified":"2019-03-20T22:30:45+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158"},"description":"Extended Events in Azure Data Studio can be started via an extension,and gives the similar functionality as what you see in XEvents Profiler in SSMS.","breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/extended-events-in-azure-data-studio\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/erin\/"},{"@type":"ListItem","position":2,"name":"Extended Events in Azure Data Studio"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/erin\/","name":"Erin Stellato","description":"The SQL Sequel","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/erin\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158","name":"Erin Stellato","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g","caption":"Erin Stellato"},"sameAs":["http:\/\/3.209.169.194\/blogs\/erin"],"url":"https:\/\/www.sqlskills.com\/blogs\/erin\/author\/erin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts\/997"}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/comments?post=997"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts\/997\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/media?parent=997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/categories?post=997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/tags?post=997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}