<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>boB 'The Tool Man' Taylor</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/bobtaylor/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/bobtaylor/feed.xml</link>
    <description>The place to go for SQL Server tools, tricks, and tips</description>
    <lastBuildDate>Tue, 16 Apr 2019 04:48:10 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>An interesting customer question explained</title>
      <link>https://docs.microsoft.com/archive/blogs/bobtaylor/an-interesting-customer-question-explained</link>
      <pubDate>Tue, 02 Oct 2018 23:36:38 GMT</pubDate>
      <dc:creator><![CDATA[boB 'The Tool Man' Taylor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobtaylor/?p=1115</guid>
      <description><![CDATA[While at a customer today I was given an interesting question. The individual was writing reports...]]></description>
      <content:encoded><![CDATA[While at a customer today I was given an interesting question. The individual was writing reports and needed to have right-justified, zero padded fields. He was investigating the FORMAT function which was introduced in SQL Server 2012. He had heard some mumblings that the FORMAT function was not as performant as good ole number stuffing. He wanted to understand why.

So basically, he wanted a cook-off between
<h4>SELECT FORMAT(N, 'd10') as padWithZeroes FROM FormatTest;</h4>
<h4>and</h4>
<h4>SELECT RIGHT('0000000000'+RTRIM(CAST (N as varchar(5))),10) from FormatTest;</h4>
<span style="float: none;background-color: transparent;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: left;text-decoration: none;text-indent: 0px"> I had a hunch but wanted empirical evidence...</span>

so fire up ssms and our trusty query store and create a repro.

[snippet slug=format-vs-stuff lang=sql]

So now to examine the Query Store runtime execution statistics

[snippet slug=query-store-query lang=sql]

And as I suspected FORMAT is utilizing the SQL CLR services as we see almost all the time being spent in CLR. Question answered.

<a href="https://msdnshared.blob.core.windows.net/media/2018/10/querystorequeryresults.png"><img width="300" height="40" class="alignnone size-medium wp-image-1195" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/10/querystorequeryresults-300x40.png" /></a>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Next on the Menu - A new tool!  xel2sql</title>
      <link>https://docs.microsoft.com/archive/blogs/bobtaylor/next-on-the-menu-a-new-tool-xel2sql</link>
      <pubDate>Mon, 20 Aug 2018 08:00:01 GMT</pubDate>
      <dc:creator><![CDATA[boB 'The Tool Man' Taylor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobtaylor/?p=1085</guid>
      <description><![CDATA[Based on a request by Microsoft Test Consultant Robert George, this SQL Snacks™ along with a tool I...]]></description>
      <content:encoded><![CDATA[Based on a request by Microsoft Test Consultant Robert George, this <strong>SQL Snacks™</strong> along with a tool I am releasing to the community will allow you to run a Transact-SQL workload on Azure SQL Database, capture the xel files to Azure Blob Storage, and then process them to produce an executable Transact-SQL Script that duplicates the captured workload.

The source code (quite simple) is available on my GitHub repo  <a href="https://github.com/bobtaylor29708/xel2sql">https://github.com/bobtaylor29708/xel2sql</a>

[video width="1620" height="1080" mp4="https://msdnshared.blob.core.windows.net/media/2018/08/xel2sql.mp4" autoplay="true"][/video]

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Next on the Menu - Why is that recompiling?</title>
      <link>https://docs.microsoft.com/archive/blogs/bobtaylor/next-on-the-menu-why-is-that-recompiling</link>
      <pubDate>Mon, 13 Aug 2018 20:04:22 GMT</pubDate>
      <dc:creator><![CDATA[boB 'The Tool Man' Taylor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobtaylor/?p=1065</guid>
      <description><![CDATA[In this short SQL Snacks™  we will look at a question that arose while I was at a customer site....]]></description>
      <content:encoded><![CDATA[<span style="float: none;background-color: transparent;color: #333333;font-family: 'Segoe UI',Tahoma,Arial,'Helvetica Neue',Helvetica,Sans-Serif;font-size: 14px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: left;text-decoration: none;text-indent: 0px">In this short </span><strong>SQL Snacks™</strong><span style="float: none;background-color: transparent;color: #333333;font-family: 'Segoe UI',Tahoma,Arial,'Helvetica Neue',Helvetica,Sans-Serif;font-size: 14px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: left;text-decoration: none;text-indent: 0px"> </span><strong> </strong><span style="float: none;background-color: transparent;color: #333333;font-family: 'Segoe UI',Tahoma,Arial,'Helvetica Neue',Helvetica,Sans-Serif;font-size: 14px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: left;text-decoration: none;text-indent: 0px">we will </span>look at a question that arose while I was at a customer site. While running load tests we were seeing abnormally high numbers of recompiles vs. compiles. Knowing that this could lead to higher CPU consumption we investigated. Thanks to Forrest McDaniel @TSQLAddict for the basis of this <b>SQL Snack™</b>

Check out his blog at <a href="https://www.forrestmcdaniel.com">Forrest Shares</a>

[video width="1620" height="1080" mp4="https://msdnshared.blob.core.windows.net/media/2018/08/Recompiles.mp4"][/video]]]></content:encoded>
    </item>
    <item>
      <title>Next on the Menu - XE Profiler</title>
      <link>https://docs.microsoft.com/archive/blogs/bobtaylor/next-on-the-menu-xe-profiler</link>
      <pubDate>Mon, 06 Aug 2018 18:00:16 GMT</pubDate>
      <dc:creator><![CDATA[boB 'The Tool Man' Taylor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobtaylor/?p=985</guid>
      <description><![CDATA[In this short SQL Snacks™  we will examine a feature introduced in SQL Server Management Studio...]]></description>
      <content:encoded><![CDATA[In this short <strong>SQL Snacks™</strong> <strong> </strong>we will examine a feature introduced in SQL Server Management Studio V17.3 - namely the XE Profiler which will make our lives considerably easier when configuring XEvent capture for a test run.

[video width="1620" height="1080" mp4="https://msdnshared.blob.core.windows.net/media/2018/07/XE-Profiler.mp4" autoplay="true"][/video]]]></content:encoded>
    </item>
    <item>
      <title>Next on the Menu - counter, histogram, and pair matching targets</title>
      <link>https://docs.microsoft.com/archive/blogs/bobtaylor/next-on-the-menu-counter-histogram-and-pair-matching-targets</link>
      <pubDate>Mon, 30 Jul 2018 08:00:43 GMT</pubDate>
      <dc:creator><![CDATA[boB 'The Tool Man' Taylor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobtaylor/?p=955</guid>
      <description><![CDATA[In this SQL Snack™ I will examine the three remaining targets (I don't plan on covering the ETW sync...]]></description>
      <content:encoded><![CDATA[In this <strong>SQL Snack™</strong> I will examine the three remaining targets (I don't plan on covering the ETW sync target as it is out of scope for this series). The counter, histogram and pair matching targets are very simple and straight forward to use and consume.

In the next <b>SQL Snack™</b> I will examine a new tool found in SQL Server Management Studio since version 17.3, namely the XE Profiler

[video width="1620" height="1080" mp4="https://msdnshared.blob.core.windows.net/media/2018/06/counter-histogram-and-pair-matching-targets.mp4" autoplay="true"][/video]]]></content:encoded>
    </item>
    <item>
      <title>Next on the Menu – event file target for Azure SQL Database</title>
      <link>https://docs.microsoft.com/archive/blogs/bobtaylor/next-on-the-menu-event-file-target-for-azure-sql-database</link>
      <pubDate>Mon, 23 Jul 2018 08:00:46 GMT</pubDate>
      <dc:creator><![CDATA[boB 'The Tool Man' Taylor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobtaylor/?p=925</guid>
      <description><![CDATA[In this SQL Snacks™ we will examine the techniques required to implement the file target for an...]]></description>
      <content:encoded><![CDATA[In this <strong>SQL Snacks™ </strong>we will examine the techniques required to implement the file target for an Azure SQL Database. We will also examine the differences in the Extended Event system between on premises and Azure SQL Database.

The link with the instructions for creating Azure Blob Storage can be <a href="https://docs.microsoft.com/en-us/azure/sql-database/sql-database-xevent-code-event-file#phase-1-powershell-code-for-azure-storage-container">found here.</a>

As I mentioned in the <b>SQL Snacks™</b> if there is enough interest I would record a <b>SQL Snacks™</b> demonstrating the process by using the Azure Portal and by using PowerShell.

[video width="1620" height="1080" mp4="https://msdnshared.blob.core.windows.net/media/2018/06/ASD-File-Target.mp4"][/video]]]></content:encoded>
    </item>
    <item>
      <title>Next on the Menu – event file target deep dive</title>
      <link>https://docs.microsoft.com/archive/blogs/bobtaylor/next-on-the-menu-event-file-target-deep-dive</link>
      <pubDate>Mon, 23 Jul 2018 08:00:37 GMT</pubDate>
      <dc:creator><![CDATA[boB 'The Tool Man' Taylor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobtaylor/?p=885</guid>
      <description><![CDATA[In this SQL Snacks™ we will examine the event file target. Along the way we will unlock the magic of...]]></description>
      <content:encoded><![CDATA[In this <strong>SQL Snacks™ </strong>we will examine the event file target. Along the way we will unlock the magic of the Extended Event viewer UI in SQL Server Management Studio.

Again this is longer than most <strong>SQL Snacks™ </strong>so the video will be in two parts.

In the companion <strong>SQL Snacks™ </strong>this week we will examine the steps necessary to create and consume event file targets for Azure SQL Database.

[video width="1620" height="1080" mp4="https://msdnshared.blob.core.windows.net/media/2018/06/Event-File-Target-part-1.mp4"][/video]

[video width="1620" height="1080" mp4="https://msdnshared.blob.core.windows.net/media/2018/06/Event-File-Target-part-2.mp4"][/video]]]></content:encoded>
    </item>
    <item>
      <title>Next on the Menu - Ring Buffer Target Deep Dive</title>
      <link>https://docs.microsoft.com/archive/blogs/bobtaylor/next-on-the-menu-ring-buffer-target-deep-dive</link>
      <pubDate>Mon, 16 Jul 2018 08:00:21 GMT</pubDate>
      <dc:creator><![CDATA[boB 'The Tool Man' Taylor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobtaylor/?p=855</guid>
      <description><![CDATA[In this SQL Snacks™ we will examine the Ring Buffer Extended Event target. Arguably the most...]]></description>
      <content:encoded><![CDATA[In this <span style="font-size: 13px"><strong><span style="text-align: left;color: #444444;text-indent: 0px;letter-spacing: normal;font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;font-style: normal;font-variant: normal;text-decoration: none;cursor: pointer;float: none;background-color: transparent">SQL Snacks™</span></strong></span> we will examine the Ring Buffer Extended Event target. Arguably the most flexible of the targets (despite a few of its shortfalls) we will use it to start the examination of the suite of targets available to us.

In a future <span style="float: none;background-color: transparent;color: #444444;cursor: pointer;font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;font-size: 13px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: left;text-decoration: none;text-indent: 0px">S<strong>QL Snacks™</strong></span> we will examine the file target which is very powerful. We will examine programmatic ways to consume the file target and we will also dive deep on the capabilities in the SSMS UI for manipulating Xevent target data.

[video width="1620" height="1080" mp4="https://msdnshared.blob.core.windows.net/media/2018/06/Ring-Buffer-Target-Deep-Dive.mp4" autoplay="true"][/video]]]></content:encoded>
    </item>
    <item>
      <title>Thanks to your feedback - SqlCommandFilters has been improved!</title>
      <link>https://docs.microsoft.com/archive/blogs/bobtaylor/thanks-to-your-feedback-sqlcommandfilters-has-been-improved</link>
      <pubDate>Thu, 12 Jul 2018 18:54:17 GMT</pubDate>
      <dc:creator><![CDATA[boB 'The Tool Man' Taylor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobtaylor/?p=1015</guid>
      <description><![CDATA[Thanks to reader EricEJ I have added an extension method to SqlCommandFilters which means instead of...]]></description>
      <content:encoded><![CDATA[Thanks to reader EricEJ I have added an extension method to SqlCommandFilters which means instead of coding the call like this

// Explicit usage
//SqlCommandFilters.Parameters.Parameterize(ref cmd);

you can now call it like this

// Extension method on SqlCommand
cmd.Parameterize(false);

To do so requires two changes to the Parameters class

first you need to modify the class definition to be static

//was public class Parameters

public <strong>static</strong> class Parameters

And then you need to add the extension method itself.

<strong>public static void Parameterize</strong>(this SqlCommand cmd, bool reparse = true)
{
Parameterize(ref cmd, reparse);
}

And just like that SqlCommandFilters is now an extension method on SqlCommand class!

I will be checking in the change (and the change to the test app) to GitHub when I get back from family holiday.]]></content:encoded>
    </item>
    <item>
      <title>Next on the Menu - a reusable pattern for parsing Xevent data</title>
      <link>https://docs.microsoft.com/archive/blogs/bobtaylor/next-on-the-menu-a-reusable-pattern-for-parsing-xevent-data</link>
      <pubDate>Mon, 09 Jul 2018 08:00:01 GMT</pubDate>
      <dc:creator><![CDATA[boB 'The Tool Man' Taylor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bobtaylor/?p=835</guid>
      <description><![CDATA[In this SQL Snacks™ I will demonstrate a simple, three step process for writing a Transact-SQL...]]></description>
      <content:encoded><![CDATA[In this <span style="font-size: 13px"><strong><span style="text-align: left;color: #444444;text-indent: 0px;letter-spacing: normal;font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;font-style: normal;font-variant: normal;text-decoration: none;cursor: pointer;float: none;background-color: transparent">SQL Snacks™</span></strong><span style="text-align: left;color: #444444;text-indent: 0px;letter-spacing: normal;font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;font-style: normal;font-variant: normal;text-decoration: none;cursor: pointer;float: none;background-color: transparent"> I will demonstrate a simple, three step process for writing a Transact-SQL script that can parse your Extended Event Session data.</span></span>

Then, in the upcoming <span style="font-size: 13px"><strong><span style="text-align: left;color: #444444;text-indent: 0px;letter-spacing: normal;font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;font-style: normal;font-variant: normal;text-decoration: none;cursor: pointer;float: none;background-color: transparent">SQL Snacks™ </span></strong><span style="text-align: left;color: #444444;text-indent: 0px;letter-spacing: normal;font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;font-style: normal;font-variant: normal;text-decoration: none;cursor: pointer;float: none;background-color: transparent">I will examine each target type individually with demo code for you to use.</span></span>

[video width="1620" height="1080" mp4="https://msdnshared.blob.core.windows.net/media/2018/06/Xevent-Data-Parsing.mp4" autoplay="true"][/video]

&nbsp;]]></content:encoded>
    </item>
  </channel>
</rss>