{"id":71538,"date":"2017-06-28T11:11:27","date_gmt":"2017-06-28T11:11:27","guid":{"rendered":"https:\/\/www.simple-talk.com\/?p=71538"},"modified":"2021-08-24T13:39:24","modified_gmt":"2021-08-24T13:39:24","slug":"new-t-sql-functions-sql-server-2017","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/new-t-sql-functions-sql-server-2017\/","title":{"rendered":"New T-SQL Functions in SQL Server 2017"},"content":{"rendered":"<p><strong>SQL Server 2017<\/strong> brings us some new <strong>T-SQL<\/strong> functions. They are very simple to use, and can also help us to simplify our <strong>T-SQL<\/strong> code.\u00a0I&#8217;ll be talking\u00a0about them in this article.<\/p>\n<h2><strong>String_AGG<\/strong><\/h2>\n<p>This new function solves an old and very interesting problem: How can we concatenate the contents of a column from several records in a single string value, in a particular order?<\/p>\n<p>There are several points where you migh need this. For example, when some people have several e-mail addresses, or several phone numbers, and we would like to print a report with all these emails and phone numbers listed.<\/p>\n<p>This was \u00a0difficult to do up to now, \u00a0though it was possible to\u00a0achieve this with some <strong>XML<\/strong> tricks.<\/p>\n<p>Let&#8217;s try an example. This script below creates a table and insert some records.<\/p>\n<blockquote>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"> <span style=\"color: blue;\">drop<\/span>\u00a0<span style=\"color: blue;\">table<\/span><span style=\"color: blue;\">if<\/span>\u00a0<span style=\"color: blue;\">exists<\/span>\u00a0<span style=\"color: maroon;\">names<\/span> <\/p>\n<p> <span style=\"color: blue;\">create<\/span>\u00a0<span style=\"color: blue;\">table<\/span>\u00a0<span style=\"color: maroon;\">names<\/span> <br \/>\n <span style=\"color: maroon;\">(<\/span>\u00a0<span style=\"color: maroon;\">[name]<\/span>\u00a0<span style=\"color: maroon;\">varchar<\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: black;\">50<\/span><span style=\"color: maroon;\">)<\/span>\u00a0<span style=\"color: maroon;\">)<\/span><\/span><\/div>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"><span style=\"color: maroon;\">go<\/span><\/span><\/div>\n<div>\u00a0<\/div>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"><span style=\"color: blue;\">insert<\/span>\u00a0<span style=\"color: blue;\">into<\/span>\u00a0<span style=\"color: maroon;\">names<\/span>\u00a0<span style=\"color: blue;\">values<\/span>\u00a0<span style=\"color: maroon;\">(<\/span><span style=\"color: red;\">&#8216;joao&#8217;<\/span><span style=\"color: maroon;\">)<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: red;\">&#8216;jose&#8217;<\/span><span style=\"color: maroon;\">)<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: red;\">&#8216;maria&#8217;<\/span><span style=\"color: maroon;\">)<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: red;\">&#8216;joaquim&#8217;<\/span><span style=\"color: maroon;\">)<\/span><\/span><\/div>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"><span style=\"color: maroon;\">go<\/span> <\/span><\/div>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p>This query below uses some tricks with <strong>XML<\/strong> to concatenate the names in a single comma-separated string:<\/p>\n<blockquote>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"> <span style=\"color: blue;\">select<\/span>\u00a0<span style=\"color: fuchsia;\"><i>stuff<\/i><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: blue;\">select<\/span>\u00a0<span style=\"color: red;\">&#8216;,&#8217;<\/span>\u00a0<span style=\"color: silver;\">+<\/span>\u00a0<span style=\"color: maroon;\">[name]<\/span>\u00a0<span style=\"color: blue;\">as<\/span>\u00a0<span style=\"color: maroon;\">[text()]<\/span> <br \/>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: blue;\">from<\/span>\u00a0<span style=\"color: maroon;\">names<\/span>\u00a0<span style=\"color: blue;\">for<\/span>\u00a0<span style=\"color: maroon;\">xml<\/span>\u00a0<span style=\"color: maroon;\">path<\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: red;\">&#8221;<\/span><span style=\"color: maroon;\">)<\/span><span style=\"color: maroon;\">)<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: black;\">1<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: black;\">1<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: red;\">&#8221;<\/span><span style=\"color: maroon;\">)<\/span> <\/span><\/div>\n<div>\u00a0<\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-71539\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2017\/06\/NewFunctions1.png\" alt=\"string concatenation\" width=\"257\" height=\"78\" \/><\/div>\n<\/blockquote>\n<p>The new <strong>STRING_AGG<\/strong> function gives us the same result:<\/p>\n<blockquote>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"> <span style=\"color: blue;\">select<\/span>\u00a0<span style=\"color: #ff0080;\"><b>string_agg<\/b><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: maroon;\">[name]<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: red;\">&#8216;,&#8217;<\/span><span style=\"color: maroon;\">)<\/span> <br \/>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: blue;\">from<\/span>\u00a0<span style=\"color: maroon;\">names<\/span><\/span><\/div>\n<\/blockquote>\n<p>The <strong>AdventureWorks<\/strong> database has another interesting example where this function can be used. The tables <em>&#8216;Person.Person&#8217;<\/em> and <em>&#8216;Person.EmailAddress&#8217;<\/em> are related and each people can have several email addresses. It&#8217;s an usual need to list the people with their email addresses in a single record.<\/p>\n<p>This query below should achieve this, \u00a0but there is a catch:<\/p>\n<blockquote>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"> <span style=\"color: blue;\">select<\/span>\u00a0<span style=\"color: maroon;\">lastname<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: #ff0080;\"><b>string_agg<\/b><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: maroon;\">emailaddress<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: red;\">&#8216;,\u00a0&#8216;<\/span><span style=\"color: maroon;\">)<\/span>\u00a0<span style=\"color: maroon;\">email<\/span> <br \/>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: blue;\">from<\/span>\u00a0<span style=\"color: maroon;\">person<\/span><span style=\"color: silver;\">.<\/span><span style=\"color: maroon;\">person<\/span><span style=\"color: silver;\">,<\/span>\u00a0<span style=\"color: maroon;\">person<\/span><span style=\"color: silver;\">.<\/span><span style=\"color: maroon;\">EmailAddress<\/span> <br \/>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: blue;\">where<\/span>\u00a0<span style=\"color: maroon;\">person<\/span><span style=\"color: silver;\">.<\/span><span style=\"color: maroon;\">BusinessEntityID<\/span><span style=\"color: silver;\">=<\/span><span style=\"color: maroon;\">EmailAddress<\/span><span style=\"color: silver;\">.<\/span><span style=\"color: maroon;\">BusinessEntityID<\/span> <br \/>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: blue;\">group<\/span>\u00a0<span style=\"color: blue;\">by<\/span>\u00a0<span style=\"color: maroon;\">lastname<\/span> <\/span><\/div>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p>The result will be the following error:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-71540\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2017\/06\/NewFunctions2.png\" alt=\"string size limit\" width=\"966\" height=\"97\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The size limit of the <strong>string_agg<\/strong> function results depends on the datatype that is passed to it. Usually, the data type will be varchar, as in the example above, and because the datatype of the column is 8000 bytes, the size limit for the aggregated column will be 8000 bytes.<\/p>\n<p>We saw this error message even though we have no\u00a0\u00a0record over 8000 bytes, but the records combined together exceeded 8000 bytes.\u00a0<\/p>\n<p>The solution is to change the datatype of the field. We can use the <strong>&#8216;Cast&#8217;<\/strong> function for this:<\/p>\n<blockquote>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"> <span style=\"color: blue;\">select<\/span>\u00a0<span style=\"color: maroon;\">lastname<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: #ff0080;\"><b>string_agg<\/b><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: fuchsia;\"><i>cast<\/i><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: maroon;\">emailaddress<\/span>\u00a0<span style=\"color: blue;\">as<\/span>\u00a0<span style=\"color: black;\"><i>varchar<\/i><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: maroon;\">max<\/span><span style=\"color: maroon;\">)<\/span><span style=\"color: maroon;\">)<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: red;\">&#8216;,\u00a0&#8216;<\/span><span style=\"color: maroon;\">)<\/span>\u00a0<span style=\"color: maroon;\">email<\/span> <br \/>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: blue;\">from<\/span>\u00a0<span style=\"color: maroon;\">person<\/span><span style=\"color: silver;\">.<\/span><span style=\"color: maroon;\">person<\/span><span style=\"color: silver;\">,<\/span>\u00a0<span style=\"color: maroon;\">person<\/span><span style=\"color: silver;\">.<\/span><span style=\"color: maroon;\">EmailAddress<\/span> <br \/>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: blue;\">where<\/span>\u00a0<span style=\"color: maroon;\">person<\/span><span style=\"color: silver;\">.<\/span><span style=\"color: maroon;\">BusinessEntityID<\/span><span style=\"color: silver;\">=<\/span><span style=\"color: maroon;\">EmailAddress<\/span><span style=\"color: silver;\">.<\/span><span style=\"color: maroon;\">BusinessEntityID<\/span> <br \/>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: blue;\">group<\/span>\u00a0<span style=\"color: blue;\">by<\/span>\u00a0<span style=\"color: maroon;\">lastname<\/span> <\/span><\/div>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<h2><strong>Trim<\/strong><\/h2>\n<p>This new function has been requested for a lot of SQL Server DBAs for a long time.<\/p>\n<p>Removing the empty spaces in a string always demanded the use of two functions, like this:<\/p>\n<blockquote>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"> <span style=\"color: blue;\">SELECT<\/span>\u00a0<span style=\"color: fuchsia;\"><i>RTRIM<\/i><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: fuchsia;\"><i>LTRIM<\/i><\/span><span style=\"color: maroon;\">(<\/span>\u00a0<span style=\"color: red;\">&#8216;\u00a0\u00a0\u00a0\u00a0\u00a0test\u00a0\u00a0\u00a0\u00a0&#8216;<\/span><span style=\"color: maroon;\">)<\/span><span style=\"color: maroon;\">)<\/span>\u00a0<span style=\"color: blue;\">AS<\/span>\u00a0<span style=\"color: maroon;\">Result<\/span><span style=\"color: silver;\">;<\/span> <\/span><\/div>\n<\/blockquote>\n<p>This new function simplifies this task:<\/p>\n<blockquote>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"> <span style=\"color: blue;\">SELECT<\/span>\u00a0<span style=\"color: #ff0080;\"><b>TRIM<\/b><\/span><span style=\"color: maroon;\">(<\/span>\u00a0<span style=\"color: red;\">&#8216;\u00a0\u00a0\u00a0\u00a0\u00a0test\u00a0\u00a0\u00a0\u00a0&#8216;<\/span><span style=\"color: maroon;\">)<\/span>\u00a0<span style=\"color: blue;\">AS<\/span>\u00a0<span style=\"color: maroon;\">Result<\/span><span style=\"color: silver;\">;<\/span> <\/span><\/div>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<h2><strong>Concat_WS<\/strong><\/h2>\n<p><strong>Concat_WS<\/strong> function is similar to the Concat function that exists since SQL Server 2012, with the &#8216;WS&#8217; as a plus. &#8216;WS&#8217; in this case means <em>&#8216;With Separator&#8217;<\/em>, meaning this new function is able to add a separator between each string value it concatenates.<\/p>\n<p>The NULL value behavior with both functions is the same: NULL values are ignored, not even adding the separator.<\/p>\n<p>This isn&#8217;t SQL Server&#8217;s default behavior in a concatenation. By default, concatenating a NULL value with a string value yields a null value. Despite\u00a0what a lot of people believe, NULL doesn&#8217;t mean an empty value, NULL means an unknown value. That&#8217;s why any value concatenated with NULL yields NULL: the result is also unknown.<\/p>\n<p>SQL Server has a session configuration called <strong>CONCAT_NULL_YIELDS_NULL<\/strong>, but this configuration is deprecated. You can see more about this <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/statements\/set-concat-null-yields-null-transact-sql\">here<\/a>\u00a0<\/p>\n<p>Both functions, <strong>CONCAT<\/strong> and <strong>CONCAT_WS<\/strong>, ignores the default behavior and the <strong>CONCAT_NULL_YIELDS_NULL<\/strong> configuration, ignoring NULL values during the concatenation.<\/p>\n<p>This is very useful to simplify the queries when we need to concatenate fields that aren&#8217;t always filled, such as address fields, that sometimes have all the fields filled and sometimes haven&#8217;t.<\/p>\n<p>The first example below use a comma as a separator, the 2nd uses a carriage-return (char(13)) :<\/p>\n<blockquote>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"> <span style=\"color: blue;\">SELECT<\/span>\u00a0<span style=\"color: #ff0080;\"><b>CONCAT_WS<\/b><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: red;\">&#8216;,&#8217;<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: red;\">&#8216;1\u00a0Microsoft\u00a0Way&#8217;<\/span><span style=\"color: silver;\">,<\/span>\u00a0<span style=\"color: blue;\">NULL<\/span><span style=\"color: silver;\">,<\/span>\u00a0<span style=\"color: blue;\">NULL<\/span><span style=\"color: silver;\">,<\/span>\u00a0<span style=\"color: red;\">&#8216;Redmond&#8217;<\/span><span style=\"color: silver;\">,<\/span>\u00a0<span style=\"color: red;\">&#8216;WA&#8217;<\/span><span style=\"color: silver;\">,<\/span>\u00a0<span style=\"color: black;\">98052<\/span><span style=\"color: maroon;\">)<\/span>\u00a0<span style=\"color: blue;\">AS<\/span>\u00a0<span style=\"color: maroon;\">Address<\/span><span style=\"color: silver;\">;<\/span> <\/span><\/div>\n<p><span style=\"font-family: Courier New; font-size: 10pt;\"> <span style=\"color: blue;\">select<\/span>\u00a0<span style=\"color: #ff0080;\"><b>Concat_WS<\/b><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: fuchsia;\"><i>char<\/i><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: black;\">13<\/span><span style=\"color: maroon;\">)<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: maroon;\">addressline1<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: maroon;\">addressline2<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: maroon;\">city<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: maroon;\">PostalCode<\/span><span style=\"color: maroon;\">)<\/span> <br \/>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: blue;\">as<\/span>\u00a0<span style=\"color: maroon;\">[Address]<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: maroon;\">AddressId<\/span> <br \/>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: blue;\">from<\/span>\u00a0<span style=\"color: maroon;\">person<\/span><span style=\"color: silver;\">.<\/span><span style=\"color: maroon;\">Address<\/span> <\/span><\/p>\n<\/blockquote>\n<p>This function can be useful to produce reports, concatenating some fields, however it&#8217;s not useful for exporting data, because when we export data we need some kind of separator, such as a semi-colon (&#8220;;&#8221;) even when a field is NULL, but this function doesn&#8217;t add the separator\u00a0when a field is NULL.<\/p>\n<h2><strong>Translate<\/strong><\/h2>\n<p>Translate does the work of several replace functions, simplifying some queries.<\/p>\n<p>The function is called <strong>&#8216;Translate&#8217;<\/strong> because its main objective: transform one kind of information in another by doing a bunch of replaces.<\/p>\n<p>For example: GeoJson and WKT are two different formats for coordinates. In GeoJson a coordinate is represented using the format <em>&#8216;[137.4, 72.3]&#8217;<\/em> while in WKT a point is represented using the format<em> &#8216;(137.4 72.3)&#8217;<\/em>.<\/p>\n<p>We would need several <strong>&#8216;Replace&#8217;s<\/strong> to transform GeoJson format in WKT format and the reverse. The <strong>&#8216;Translate&#8217;<\/strong> function can do this easily.<\/p>\n<p>Using <strong>&#8216;Replace&#8217;<\/strong> function the transformation would be like this:<\/p>\n<blockquote>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"> <span style=\"color: blue;\">select<\/span>\u00a0<span style=\"color: fuchsia;\"><i>replace<\/i><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: fuchsia;\"><i>replace<\/i><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: fuchsia;\"><i>replace<\/i><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: red;\">&#8216;[137.4,\u00a072.3]&#8217;<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: red;\">&#8216;[&#8216;<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: red;\">&#8216;(&#8216;<\/span><span style=\"color: maroon;\">)<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: red;\">&#8216;,&#8217;<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: red;\">&#8216;\u00a0&#8216;<\/span><span style=\"color: maroon;\">)<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: red;\">&#8216;]&#8217;<\/span><span style=\"color: silver;\">,<\/span><span style=\"color: red;\">&#8216;)&#8217;<\/span><span style=\"color: maroon;\">)<\/span>\u00a0<span style=\"color: blue;\">as<\/span>\u00a0<span style=\"color: maroon;\">Point<\/span> <\/span><\/div>\n<\/blockquote>\n<p>Using the <strong>&#8216;Translate&#8217;<\/strong> function the transformations becomes way simpler:<\/p>\n<blockquote>\n<div><span style=\"font-family: Courier New; font-size: 10pt;\"> <span style=\"color: blue;\">SELECT<\/span>\u00a0<span style=\"color: #ff0080;\"><b>TRANSLATE<\/b><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: red;\">&#8216;[137.4,\u00a072.3]&#8217;<\/span>\u00a0<span style=\"color: silver;\">,<\/span>\u00a0<span style=\"color: red;\">&#8216;[,]&#8217;<\/span><span style=\"color: silver;\">,<\/span>\u00a0<span style=\"color: red;\">&#8216;(\u00a0)&#8217;<\/span><span style=\"color: maroon;\">)<\/span>\u00a0<span style=\"color: blue;\">AS<\/span>\u00a0<span style=\"color: maroon;\">Point<\/span><span style=\"color: silver;\">,<\/span> <br \/>\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #ff0080;\"><b>TRANSLATE<\/b><\/span><span style=\"color: maroon;\">(<\/span><span style=\"color: red;\">&#8216;(137.4\u00a072.3)&#8217;<\/span>\u00a0<span style=\"color: silver;\">,<\/span>\u00a0<span style=\"color: red;\">&#8216;(\u00a0)&#8217;<\/span><span style=\"color: silver;\">,<\/span>\u00a0<span style=\"color: red;\">&#8216;[,]&#8217;<\/span><span style=\"color: maroon;\">)<\/span>\u00a0<span style=\"color: blue;\">AS<\/span>\u00a0<span style=\"color: maroon;\">Coordinates<\/span> <\/span><\/div>\n<\/blockquote>\n<p>Instead of several <em>&#8216;Replaces&#8217;<\/em>, the <em>&#8216;Translate&#8217;<\/em> syntax allows us to specify all the characters in the source string we would like to replace and all the new characters.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL Server 2017 brings us some new T-SQL functions. They are very simple to use, and can also help us to simplify our T-SQL code.\u00a0I&#8217;ll be talking\u00a0about them in this article. String_AGG This new function solves an old and very interesting problem: How can we concatenate the contents of a column from several records in&#8230;&hellip;<\/p>\n","protected":false},"author":50808,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2,143527],"tags":[5134],"coauthors":[6810],"class_list":["post-71538","post","type-post","status-publish","format-standard","hentry","category-blogs","category-database-administration-sql-server","tag-sql-prompt"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/71538","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\/50808"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=71538"}],"version-history":[{"count":5,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/71538\/revisions"}],"predecessor-version":[{"id":83070,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/71538\/revisions\/83070"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=71538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=71538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=71538"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=71538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}