{"id":106777,"date":"2025-05-26T14:34:59","date_gmt":"2025-05-26T14:34:59","guid":{"rendered":"https:\/\/www.red-gate.com\/simple-talk\/?p=106777"},"modified":"2025-05-27T14:24:10","modified_gmt":"2025-05-27T14:24:10","slug":"distinct-and-union-what-happens-when-you-use-them-together","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/databases\/sql-server\/t-sql-programming-sql-server\/distinct-and-union-what-happens-when-you-use-them-together\/","title":{"rendered":"DISTINCT and UNION: What happens when you use them together?"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>When I was perusing my LinkedIn feed the other day, I came across t<a href=\"https:\/\/www.linkedin.com\/feed\/update\/urn:li:activity:7326553064637636608\">his thread about using SELECT *<\/a>. In one of the replies, Aaron Cutshall noted that: &#8220;Another real performance killer is <code>SELECT DISTINCT<\/code> especially when combined with <code>UNION<\/code>. I have a whole list of commonly used hidden performance killers!&#8221;<\/p>\n\n\n\n<p>To which started my brain thinking&#8230; What does happen when you use these together? And when you use UNION on a set with non-distinct rows, what happens. So for the next few hours I started writing.<\/p>\n\n\n\n<p><strong>UNION and DISTINCT<\/strong><\/p>\n\n\n\n<p>You probably know what they are, I know I do. BUT just for clarification, I figured I should make sure. (About half of my professional life is verifying than I actually know what are actually pretty basic concepts. It makes me a really good editor, and it keeps me from talking like a know it all!)<\/p>\n\n\n\n<p>From the <a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/language-elements\/set-operators-union-transact-sql?view=sql-server-ver16\">Microsoft documentation on set operators<\/a>: <code>UNION<\/code> is a set operator that:<\/p>\n\n\n\n<p>&#8220;Concatenates the results of two queries into a single result set. You control whether the result set includes duplicate rows:<\/p>\n\n\n<div class=\"block-core-list\">\n<ul class=\"wp-block-list\">\n<li><code>UNION ALL<\/code> &#8211; Includes duplicates. <\/li>\n\n\n\n<li><code>UNION<\/code> &#8211; Excludes duplicates.&#8221; <\/li>\n<\/ul>\n<\/div>\n\n\n<p>That checks with my knowledge.<\/p>\n\n\n\n<p><code>DISTINCT<\/code> is a modifier that &#8220;specifies that only unique rows can appear in the result set. Null values are considered equal for the purposes of the <code>DISTINCT<\/code> keyword.&#8221;<\/p>\n\n\n\n<p>Never completely happy with that NULL business, but it has always been that way.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-why-would-you-use-them-together\">Why would you use them together?<\/h2>\n\n\n\n<p>Why indeed? I realized at this point that I am violating one of my primary tenets of writing. Don\u2019t start writing until you know the code works. I can\u2019t tell you how many times that has bitten me.<\/p>\n\n\n\n<p>But in this case, the goal here is basically a bit of a quiz. I want to be honest about my knowledge, and my limitations. Like I noted, if I am not sure sure, I will usually check or test my work. So my question is:<\/p>\n\n\n\n<p style=\"padding-right:0;padding-left:var(--wp--preset--spacing--md)\">If you have two sets of data, where at least one set include data, and that data includes duplicates. What will <code>UNION<\/code> do? and then why would you combine that with <code>DISTINCT<\/code>?<\/p>\n\n\n\n<p>So lets see what we can figure out.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-first-test-union-and-distinct\">First Test: UNION and DISTINCT<\/h2>\n\n\n\n<p>Say you have the following sets of data (The table create scripts are in the Appendix of this article, but it is just a simple table with one column (<code>Value<\/code>) and no constraints):<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">USE Tempdb;\nGO\nTRUNCATE TABLE TableA; TRUNCATE TABLE TableB;\nINSERT INTO TableA VALUES(1),(2),(3),(4);\nINSERT INTO TableB VALUES    (2),(3),(4),(5);<\/pre><\/div>\n\n\n\n<p>Now, lets UNION these two sets together:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">SELECT Value\nFROM   TableA\nUNION\nSELECT Value\nFROM   TableB;<\/pre><\/div>\n\n\n\n<p>This returns:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block\" highlight=\"false\" decode=\"true\">Value\n-----------\n1\n2\n3\n4\n5<\/pre><\/div>\n\n\n\n<p>As expected. What about the plan?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"677\" height=\"340\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/1-Screenshot-2025-05-13-224314.png\" alt=\"\" class=\"wp-image-106902\" srcset=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/1-Screenshot-2025-05-13-224314.png 677w, https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/1-Screenshot-2025-05-13-224314-300x151.png 300w\" sizes=\"auto, (max-width: 677px) 100vw, 677px\" \/><\/figure>\n\n\n\n<p>Pretty straightforward. Does table scans of each table, concatenates the two outputs, and then sorts the data and removed dups with a Distinct Sort (Sort) operator.<\/p>\n\n\n\n<p>At this point in the process, I think I begin to understand Aaron\u2019s concerns. Because if you are using them both in a query, then you wouldn\u2019t likely be putting the <code>DISTINCT<\/code> operator on both sets, rather it is going on the individual queries. Something like this:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">SELECT DISTINCT Value\nFROM   TableA\nUNION\nSELECT DISTINCT Value\nFROM   TableB;<\/pre><\/div>\n\n\n\n<p>Either one or both, and the optimizer doesn&#8217;t change that output of the query (might change the performance, of course). So, while you obviously get the same result, you get a different plan:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"775\" height=\"342\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/2-Screenshot-2025-05-13-224752.png\" alt=\"\" class=\"wp-image-106903\" srcset=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/2-Screenshot-2025-05-13-224752.png 775w, https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/2-Screenshot-2025-05-13-224752-300x132.png 300w, https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/2-Screenshot-2025-05-13-224752-768x339.png 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><\/figure>\n\n\n\n<p>This time, it fetches all the data again with Table Scan operators, deduplicates the data using the Distinct Sort (Sort) and then merges the data with a Merge Join. Interestingly, instead of doing the distinct in a sort now, it does know that it has two sorted inputs so it can do the deduplification easier with a Union (Merge Join) that tosses out duplicates.<\/p>\n\n\n\n<p>Finally, what will it do if you add the DISTINCT on the output from the UNION by using a CTE to perform the original query?<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">With BaseRows AS (\nSELECT Value\nFROM TableA\nUNION\nSELECT Value\nFROM TableB)\nSELECT DISTINCT *\nFROM BaseRows;<\/pre><\/div>\n\n\n\n<p>Of course, the same output, but we are back to the same plan as we started with. The optimizer realizes that the <code>DISTINCT<\/code> is superflous in this case and tosses out second <code>DISTINCT<\/code>. Sadly, there is no compiler warning that says: Warning: <code>Silly superfluous DISTINCT used<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-second-test-union-and-duplicated-data-from-one-side\">Second Test: UNION and Duplicated Data from One Side<\/h2>\n\n\n\n<p>Now the more interesting case to me that sort of goes outside of the <code>DISTINCT<\/code> and <code>UNION<\/code> experiment. What if one input has the duplicated data? I will reload the data like this:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">TRUNCATE TABLE TableA; TRUNCATE TABLE TableB;\nINSERT INTO TableA VALUES (1),(1),(1),(1),(2),(3),(4),(5);<\/pre><\/div>\n\n\n\n<p>Now only one table has data, and there are definitely duplicates. What will happen when this is executed?<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">SELECT DISTINCT Value\nFROM   TableA\nUNION\nSELECT DISTINCT Value\nFROM   TableB;<\/pre><\/div>\n\n\n\n<p>Pretty obviously the same output as before:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block\" highlight=\"false\" decode=\"true\">Value\n-----------\n1\n2\n3\n4\n5<\/pre><\/div>\n\n\n\n<p>The duplicates are removed in the initial queries, so the first query returns 1,2,3,4,5, and unioning that to the empty set doesn\u2019t change that..<\/p>\n\n\n\n<p>But what about this?<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">SELECT Value\nFROM   TableA\nUNION\nSELECT Value\nFROM   TableB;<\/pre><\/div>\n\n\n\n<p style=\"padding-right:0;padding-left:var(--wp--preset--spacing--md)\">Honesty point: As I am writing this, I am still in \u201cI think I know what is going to happen, but not 100% sure\u201d mode. Why don\u2019t I clearly know this? Honestly, it is kind of rare to work with UNION, because most data will have no duplicates. And 99% of the time, duplicates in your sets mean there are issues. It is why a good data programmer is not a big fan of seeing DISTINCT in code without a 100 word essay in the comments. It most often masks issues with your code.<\/p>\n\n\n\n<p>Thinking back to our previous query plan for this query, it scans the data, it concatenates the rows, then does a Distinct Sort. Which strongly indicates that we will get the same set of data, because I think the UNION operator will not only remove duplicates from the set operation, but also from either set.<\/p>\n\n\n\n<p>And the only time it used a Union (Merge Join) was when it knew it had sorted and distinct data. Much like if these sets had primary keys\\unique indexes that it could trust.<\/p>\n\n\n\n<p>So I will now guess, that the output of the simple <code>UNION<\/code> query will be the same, 5 rows, with values 1,2,3,4,5 for each row.<\/p>\n\n\n\n<p>Which it is. So I learned something, and I hope you did as well. <code>UNION<\/code> returns a distinct set of data, no matter if the duplication is from rows in each input, or only just the one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-third-test-crank-up-the-number-of-rows\">Third Test: Crank up the number of rows<\/h2>\n\n\n\n<p>Since I am here and interested. What if I loaded a load of rows into the table. Maybe 100000 each? I will put back these rows. Will it change how rows are processed? Will performance change?<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">TRUNCATE TABLE TableA; TRUNCATE TABLE TableB;\nINSERT INTO TableA VALUES(1),(2),(3),(4);\nINSERT INTO TableB VALUES    (2),(3),(4),(5);<\/pre><\/div>\n\n\n\n<p>But now I will add 100,000 sequential rows into each.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">INSERT INTO TableA\nSELECT value\nFROM   Generate_Series(6,100006);\nINSERT INTO TableB\nSELECT value\nFROM   Generate_Series(6,100006);<\/pre><\/div>\n\n\n\n<p>It should be clear that there will be loads of duplicates in these sets. Now I am going to run the same queries again. I will also turn on <code>STATISTICS IO<\/code> and <code>TIME<\/code> to see if they perform differently.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">SET STATISTICS IO,TIME ON;\nSELECT Value\nFROM TableA\nUNION\nSELECT Value\nFROM TableB;\n\nSELECT DISTINCT Value\nFROM TableA\nUNION\nSELECT DISTINCT Value\nFROM TableB;\nSET STATISTICS IO, TIME OFF;<\/pre><\/div>\n\n\n\n<p>You should get a lot of rows back, 200012 to be exact. They will likely be sorted different in the output, due to the differences in how they are being processed. I tried this on Express Edition and Developer Edition. In the first image is the Express output, and the Developer Edition used parallelism.<\/p>\n\n\n\n<p>Express Edition, No Parallelism:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"725\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/word-image-106777-3.png\" alt=\"\" class=\"wp-image-106780\" srcset=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/word-image-106777-3.png 811w, https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/word-image-106777-3-300x268.png 300w, https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/word-image-106777-3-768x687.png 768w\" sizes=\"auto, (max-width: 811px) 100vw, 811px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Developer Edition, With Parallelism:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1079\" height=\"774\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/word-image-106777-4.png\" alt=\"\" class=\"wp-image-106781\" srcset=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/word-image-106777-4.png 1079w, https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/word-image-106777-4-300x215.png 300w, https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/word-image-106777-4-1024x735.png 1024w, https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2025\/05\/word-image-106777-4-768x551.png 768w\" sizes=\"auto, (max-width: 1079px) 100vw, 1079px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>While the computed cost of the second query shows up as less, the execution of the query takes about the same time in each case, with the proper version taking the lesser time and simpler plan.<\/p>\n\n\n\n<p>In the larger, unordered sets, the plan has changed to somewhat less optimum plans. The main difference in the plan without <code>DISTINCT<\/code> is that instead of a Distinct Sort (Sort) operator, it uses an Aggregate (Hash Match) operator. This is more efficient in larger sets than sorting data that will not need to be presented sorted.<\/p>\n\n\n\n<p>On the second query, you now end up with two Aggregate (Hash Match) operators to remove the duplicated data, and then, since that data is not sorted, it uses a Union Hash Match operator (which would not need to consider that there are duplicated rows like the Aggregate one would).<\/p>\n\n\n\n<p>In the amount of time taken, on my very small data set sizes (simple integer data doesn&#8217;t use a tremendous amount of space\/memory), the no <code>DISTINCT<\/code> version was a decent bit faster. Times varied a bit, but the <code>UNION<\/code> version was consistently faster, even when the plan claimed to be faster with the parallelim.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block\" highlight=\"false\" decode=\"true\">--NO DISTINCT\nSQL Server Execution Times:\nCPU time = 157 ms, elapsed time = 921 ms.\n\n--WITH DISTINCT\nSQL Server Execution Times:\nCPU time = 218 ms, elapsed time = 1356 ms.<\/pre><\/div>\n\n\n\n<p>So around 50% faster, even if that is just over .4 seconds.<\/p>\n\n\n\n<p>Interestingly, the number of logical reads in my example turned out to be exactly the same. The output from <code>STATISTICS IO<\/code> were exactly the same:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block\" highlight=\"false\" decode=\"true\">Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, page server reads 0, read-ahead reads 0, page server read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob page server reads 0, lob read-ahead reads 0, lob page server read-ahead reads 0.\nTable 'Workfile'. Scan count 0, logical reads 0, physical reads 0, page server reads 0, read-ahead reads 0, page server read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob page server reads 0, lob read-ahead reads 0, lob page server read-ahead reads 0.\nTable 'TableB'. Scan count 1, logical reads 161, physical reads 0, page server reads 0, read-ahead reads 0, page server read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob page server reads 0, lob read-ahead reads 0, lob page server read-ahead reads 0.\nTable 'TableA'. Scan count 1, logical reads 161, physical reads 0, page server reads 0, read-ahead reads 0, page server read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob page server reads 0, lob read-ahead reads 0, lob page server read-ahead reads 0.<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-a-variation\">A variation<\/h2>\n\n\n\n<p>Lastly, let&#8217;s look at one additional way you could write this. Using a <code>UNION ALL <\/code>operator, and then using <code>DISTINCT<\/code> to eliminate duplicates (just for comparison, using <code>UNION<\/code> is still the better way unless you specifically need all the rows for processing before outputting <code>DISTINCT<\/code> rows:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">SET STATISTICS IO,TIME ON;\nWITH BaseRows AS (\nSELECT Value\nFROM TableA\nUNION ALL\nSELECT Value\nFROM TableB)\nSELECT DISTINCT Value\nFROM BaseRows\nSET STATISTICS IO, TIME OFF;<\/pre><\/div>\n\n\n\n<p>You should get the same 100006 rows output as in the previous section. The plan will more than likely be the exact same as for the <code>UNION <\/code>version of the query (since in this case you are specifically asking for the data to be concatenated and then deduped. Now this may not always be the case, with more complicated sets since the optimizer can refactor your query as needed. But suffice it to say that the output should be exactly the same.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-point-is-plus-a-tangent\">The point is, plus a tangent<\/h2>\n\n\n\n<p><code>UNION<\/code> does <code>DISTINCT<\/code> for you.<\/p>\n\n\n\n<p>No matter if the data is distinct or not in the sets you are applying the <code>UNION<\/code> operator to, it will remove duplicates. However, be careful to understand that for <code>UNION ALL<\/code>, you may actually want to do a <code>DISTINCT<\/code> on the inputs if you want to not have duplicates in one side of the object.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">TRUNCATE TABLE TableA; TRUNCATE TABLE TableB;\nINSERT INTO TableA VALUES(1),(1),(2)\nINSERT INTO TableB VALUES    (2),(3),(3);<\/pre><\/div>\n\n\n\n<p>If you want to get all of the data in both tables, but you need to remove duplicates on one side of the query, you can do this:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">SELECT Value\nFROM   TableA\nUNION ALL\nSELECT Value\nFROM   TableB\nORDER BY Value; --added for clarity<\/pre><\/div>\n\n\n\n<p>The output of this looks kind of like what you would expect for two exact sets:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block\" highlight=\"false\" decode=\"true\">Value\n-----------\n1\n1\n2\n2\n3\n3<\/pre><\/div>\n\n\n\n<p>But, it is fine to do this, if you really need it:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block lang:tsql\" highlight=\"true\" decode=\"true\">SELECT DISTINCT Value\nFROM   TableA\nUNION ALL\nSELECT DISTINCT Value\nFROM   TableB\nORDER BY Value; --added for clarity<\/pre><\/div>\n\n\n\n<p>Now the output shows <code>DISTINCT<\/code> values from one set, combined with a <code>UNION<\/code>:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block\" highlight=\"false\" decode=\"true\">Value\n-----------\n1\n2\n2\n3\n3<\/pre><\/div>\n\n\n\n<p>As always, requirements matter and if you need to do what seems like weird operations, they may be needed. The second point I want to make here is that when code smells funny, you need to doublecheck you are correct.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-appendix\">Appendix:<\/h2>\n\n\n\n<p>These are the tables that are used in the article. Nothing too complex!<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"block\" highlight=\"false\" decode=\"true\">USE TempDB;\nGO\n--note: no keys because this data may simulate any two sets of data\nCREATE TABLE TableA\n(\nValue int\n);\nCREATE TABLE TableB\n(\nValue int\n);<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>When I was perusing my LinkedIn feed the other day, I came across this thread about using SELECT *. In one of the replies, Aaron Cutshall noted that: &#8220;Another real performance killer is SELECT DISTINCT especially when combined with UNION. I have a whole list of commonly used hidden performance killers!&#8221; To which started my&#8230;&hellip;<\/p>\n","protected":false},"author":56085,"featured_media":106785,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[53,143531],"tags":[4151,4252],"coauthors":[19684],"class_list":["post-106777","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-featured","category-t-sql-programming-sql-server","tag-sql-server","tag-t-sql-programming"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/106777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/56085"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=106777"}],"version-history":[{"count":2,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/106777\/revisions"}],"predecessor-version":[{"id":106904,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/106777\/revisions\/106904"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media\/106785"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=106777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=106777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=106777"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=106777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}