{"id":94913,"date":"2022-10-21T16:37:00","date_gmt":"2022-10-21T16:37:00","guid":{"rendered":"https:\/\/www.red-gate.com\/simple-talk\/?p=94913"},"modified":"2022-10-21T16:37:00","modified_gmt":"2022-10-21T16:37:00","slug":"the-basics-of-updating-data-in-a-sql-server-table","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/databases\/sql-server\/learn\/the-basics-of-updating-data-in-a-sql-server-table\/","title":{"rendered":"The Basics of Updating Data in a SQL Server Table"},"content":{"rendered":"<p style=\"margin: 0in; font-family: Calibri; font-size: 11.0pt;\"><p><strong>This article is part of Greg Larsen's continuing series on Learning T-SQL. To see all the items in the series, <a href=\"https:\/\/www.red-gate.com\/simple-talk\/t-sql-coding-basics\/\">click here<\/a>.<\/strong><\/p>\n<\/p>\n<p>Once data is inserted into a table, data typically needs to be maintained as time goes on. To make changes to an existing row or a number of rows, in a table, the <code>UPDATE<\/code> statement is used. This article shows how to use the <code>UPDATE<\/code> statement to modify data within a SQL Server table.<\/p>\n<h2>Syntax of the UPDATE Statement<\/h2>\n<p>There are many different options supported by the <code>UPDATE<\/code> statement. This article will only be showing how to use the basic and most common options of the <code>UPDATE<\/code> statement. The syntax for that basic UPDATE statement that this article will explore can be found in Figure 1.<\/p>\n<pre class=\"lang:none theme:none\">UPDATE &lt;object&gt;\r\n    SET &lt;column_name&gt; = {expression}[ ,\u2026n]\r\n    [ &lt;OUTPUT Clause&gt; ]\r\n    [ FROM &lt;table_source&gt; [ ,\u2026n] ]\r\n    [ WHERE  &lt;search_condition&gt; ] <\/pre>\n<p><strong>Figure 1: Basic syntax for the <\/strong><code>UPDATE<\/code><strong> statement<\/strong><\/p>\n<p>Where:<\/p>\n<ul>\n<li><code>&lt;object&gt;<\/code> &#8211; is a table or view name that is being updated.<\/li>\n<li><code>&lt;column_name&gt;<\/code> &#8211; is a column that will be updated.<\/li>\n<li><code>{expression}<\/code> &#8211; is a literal string, number, or value that will be used to update the associated <code>&lt;column_name&gt;. <\/code>This value can be any scalar expression, such as supplied from a variable or even another column in the same or different table.<\/li>\n<li><code>&lt;table_source&gt;<\/code> &#8211; is a table, view or derived table that will be updated.<\/li>\n<li><code>&lt;search_condition&gt;<\/code> &#8211; is a constraint that identifies which rows are the target of the <code>UPDATE<\/code> statement.<\/li>\n<\/ul>\n<p>To understand the complete syntax of the <code>UPDATE<\/code> statement refer to the <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/queries\/update-transact-sql?view=sql-server-ver16\">Microsoft Documentation<\/a>.<\/p>\n<h2>Sample Data<\/h2>\n<p>To demonstrate how to update the values in a table, sample data will be needed. The code in Listing 1 will create and populate two different sample tables that will be used in this article.<\/p>\n<p>The code two tables: <code>dbo.Room<\/code> and <code>dbo.PriceChanges<\/code>. These tables will be used in the examples found in this article. If you want to follow along and run the examples contained in this article, use this code in Listing 1, to create these sample tables in the <code>tempdb<\/code> database on your instance of SQL Server.<\/p>\n<pre class=\"lang:none theme:none\">USE tempdb;\r\nGO\r\nCREATE TABLE dbo.Room (\r\n   RoomNum INT,\r\n   Beds INT,\r\n   Sleeps INT,\r\n   StandardRate MONEY,\r\n   PriceChangeDateTime DATETIME2(0),\r\n   RoomDesc VARCHAR(max));\r\nGO\r\nCREATE TABLE dbo.PriceChanges (\r\n   RoomNum VARCHAR(100),\r\n   NewStandardRate MONEY)\r\nGO\r\n-- INSERT Tables with Data\r\nINSERT INTO dbo.Room \r\nVALUES (1,1,2,125.99,SYSDATETIME(),\r\n        'This room has 1 king size bed, a TV with blue-ray DVD player, and private bathroom with tub'),  \r\n       (2,2,4,175.99, SYSDATETIME(),\r\n        'This room has two double beds, a TV with blue-ray DVD Player, and a private bathroom, with only a shower'),\r\n       (3,2,4,250.99, SYSDATETIME(),\r\n        'This room is a suite.  It has a private bedroom with king size bed, and private bathroom.  In the living space there is a sofa that pulls out to sleep two.  There is also a fireplace and a couple of easy chairs.  There are two TVs with blue-ray players. Has a kitchen with dishes.');\r\nINSERT INTO dbo.PriceChanges\t\r\nVALUES (1,150.99),\r\n       (2,198.99),\r\n       (3,299.99);\r\nGO<\/pre>\n<p class=\"caption\"><strong><strong>Listing 1: Sample Tables<\/strong><\/strong><\/p>\n<h2>Updating a Single Column Value on a Single Row<\/h2>\n<p>There are times when data in a single row of a table needs to be changed. It might need to be changed because it was entered incorrectly, or as time goes on the data needs to change to reflect the current situation. When a single column value, in a single row, needs to be changed the <code>UPDATE<\/code> statement can be used.<\/p>\n<p>In Listing 2 is an example that will update the value of the <code>StandardRate<\/code> column to <code>179.99<\/code> for the row where the <code>RoomNum<\/code> column is equal to 2.<\/p>\n<pre class=\"lang:none theme:none\">USE tempdb;\r\nGO\r\n\r\nUPDATE dbo.Room\r\n   SET StandardRate = 179.99\r\nWHERE RoomNum = 2;\r\nGO<\/pre>\n<p class=\"caption\">Listing 2: Updating a single column value on a single row<\/p>\n<p>In Listing 2, the <code>UPDATE<\/code> statement updated the stored value of the <code>StandardRate<\/code> column in the <code>Room<\/code> table. The <code>SET<\/code> clause was used to provide the new rate value of <code>179.99<\/code> for <code>StandardRate<\/code> column. To identify that only the row with a <code>RoomNum<\/code> of <code>2<\/code> was to be updated the <code>WHERE<\/code> clause was used.<\/p>\n<p>Care needs to be taken when issuing an <code>UPDATE<\/code> statement to ensure you don\u2019t update more rows than intended. For instance, if the <code>WHERE<\/code> clause was not included in the statement, all the rows in the <code>Room<\/code> table would have had their <code>StandardRate<\/code> value set to <code>179.99<\/code>. More on this later in the \u201cConcerns with using the <code>UPDATE<\/code> statement\u201d section below.<\/p>\n<h2>Updating Multiple Column Values on a Single Row<\/h2>\n<p>The prior example issued an <code>UPDATE<\/code> statement to modify a single column\u2019s value on a single row. The <code>UPDATE<\/code> statement allows multiple column values on a single row to be updated at the same time. When multiple columns need to be updated, the additional columns and values can be added to the <code>SET<\/code> clause, as was done on Listing 3<\/p>\n<pre class=\"lang:none theme:none\">USE tempdb;\r\nGO\r\nUPDATE dbo.Room\r\n   SET StandardRate = 299.99,\r\n   \t  PriceChangeDateTime = SYSDATETIME()\r\nWHERE RoomNum = 3;\r\nGO<\/pre>\n<p class=\"caption\"><strong><strong>Listing 3: Updating two column values on a single row<\/strong><\/strong><\/p>\n<p>This example updates the <code>StandardRate<\/code> and <code>PriceChangeDateTime<\/code> columns for only the rows where <code>RoomNum<\/code> is equal to <code>3<\/code>. To provide different values for the two different columns (<code>StandardRate<\/code> and <code>PriceChangeDateTime<\/code>) two different values were provided on the <code>SET<\/code> clause. Each column name\/value pair is separated by a comma. This example only updated two different columns. If more than 2 columns needed to have their values updated then more name\/values pairs could be added, where each pair is separated by a comma.<\/p>\n<h2>Updating Multiple Rows<\/h2>\n<p>Each example so far has only updated a single row. There are times when an applications might need to make the same column value changes to more than a single row. For instance, suppose the sample table needed to have the <code>PriceChangeDateTime<\/code> column value changed to the current date and time, on the two different rows that were updated in the last two examples. This could be accomplished by running the code in Listing 4.<\/p>\n<pre class=\"lang:none theme:none\">USE tempdb;\r\nGO\r\nUPDATE dbo.Room\r\n   SET PriceChangeDateTime = SYSDATETIME()\r\nWHERE RoomNum in (2, 3);\r\nGO<\/pre>\n<p class=\"caption\">Listing 4: Updating multiple rows with a single <code>UPDATE<\/code> statement<\/p>\n<p>When the code in Listing 4 is executed the current date and time value will be set for room numbers 2 and 3. If the <code>WHERE<\/code> clause was excluded, like in Listing 5 below, all the <code>PriceChangeDateTime<\/code> values for all rows in the <code>Room<\/code> table would have been updated.<\/p>\n<pre class=\"lang:none theme:none\">USE tempdb;\r\nGO\r\nUPDATE dbo.Room\r\n   SET PriceChangeDateTime = SYSDATETIME();\r\nGO<\/pre>\n<p class=\"caption\">Listing 5: Updating all rows in <code>Room<\/code> table<\/p>\n<p><strong>Note<\/strong>: Make sure to review the concerns section below to better understand the pitfalls that can occur when using an <code>UPDATE<\/code> statement that excludes the <code>WHERE<\/code> clause.<\/p>\n<h2>Update a table with values from another table<\/h2>\n<p>In all the examples so far, the <code>SET<\/code> clause has used a literal value to provide the new value to update the columns in the <code>Room<\/code> table. Another way to provide the values for an <code>UPDATE<\/code> statement is to provide them from another table. When the sample data was generated, a table named <code>dbo.PriceChanges<\/code> was created. This table contains price changes for each of the different rooms. To use the <code>PriceChange<\/code> table to update rows in the <code>Room<\/code> table the code in Listing 6 is provided.<\/p>\n<pre class=\"lang:none theme:none\">USE tempdb;\r\nGO\r\nUPDATE dbo.Room\r\n   SET StandardRate = PriceChanges.NewStandardRate,\r\n       PriceChangeDateTime = SYSDATETIME()\r\nFROM Room JOIN PriceChanges\r\nON Room.RoomNum = PriceChanges.RoomNum;\r\nGO<\/pre>\n<p class=\"caption\">Listing 6: Using a table to provide values for <code>UPDATE<\/code> statement<\/p>\n<p>The <code>FROM<\/code> clause joins the <code>Room<\/code> table and the <code>PriceChanges<\/code> table based on the <code>RoomNum<\/code> column in both tables. For every row that matches the join criteria SQL Server will take the <code>NewStandardRate<\/code> column value from the matching <code>PriceChanges<\/code> table and update the <code>StandardRate<\/code> column in the <em>Room <\/em>table. Additionally, the code in Listing 6 also updated the <code>PriceChangeDateTime<\/code> column with the current date and time, using the <code>SYSDATETIME<\/code>() function.<\/p>\n<p>In Listing 6 every row in the <code>Room<\/code> table got a new rate. That is because there was a matching row in the <code>PriceChanges<\/code> table for every <code>RoomNum<\/code>. If only a specific <code>RoomNum<\/code> was required to get a rate update, then a <code>WHERE<\/code> constraint could be added to the code, as shown in Listing 7.<\/p>\n<pre class=\"lang:none theme:none\">USE tempdb;\r\nGO\r\nUPDATE dbo.Room\r\n   SET StandardRate = PriceChanges.NewStandardRate,\r\n       PriceChangeDateTime = SYSDATETIME()\r\nFROM Room JOIN PriceChanges\r\nON Room.RoomNum = PriceChanges.RoomNum\r\nWHERE Room.RoomNum = 2;\r\nGO<\/pre>\n<p class=\"caption\">Listing 7: Update only <code>RoomNum<\/code> 2<\/p>\n<p>In Listing 7 the <code>WHERE<\/code> constraint identified that only <code>RoomNum<\/code> <code>2<\/code> should be updated.<\/p>\n<h2>Partial Updates of Large Data Type Columns<\/h2>\n<p>Certain datatypes can hold a large amount of data and sometimes it is better to not try to download and update the entire value. With the introduction of SQL Server 2005, Microsoft introduced the <code>WRITE<\/code> clause to perform a partial or full updates of a large data type columns (<code>varchar(max)<\/code>, <code>nvarchar(max)<\/code>, and <code>varbinary(max)<\/code>; each of which can hold up to 2GB of data in a single value). Here is the syntax for the <code>WRITE<\/code> clause:<\/p>\n<p><code>.WRITE(expression, @Offsert, @Length)<\/code><\/p>\n<p>The \u201cexpression\u201d is the value that will be written to the large data time column, the <code>@Offset<\/code> identifies the starting position of where the partial update will begin, and the <code>@Length<\/code> identifies the number of characters that will be replaced.<\/p>\n<p>The code in Listing 8 uses the <code>WRITE<\/code> clause to change the word \u201cto\u201d in the <code>RoomDesc<\/code> column to the value \u201cwhich will\u201d on only the row where the <code>RoomNum<\/code> is equal to <code>2<\/code>.<\/p>\n<pre class=\"lang:none theme:none \">USE tempdb;\r\nGO\r\nSELECT RoomDesc\r\nFROM   dbo.Room\r\nWHERE  RoomNum = 3;\r\n\r\nUPDATE dbo.Room\r\n   SET RoomDesc.WRITE --charindex finds first instance of a value\r\n                  ('which will',charindex('to',RoomDesc)-1,2)\r\nWHERE RoomNum = 3;\r\n\r\nSELECT RoomDesc\r\nFROM   dbo.Room\r\nWHERE  RoomNum = 3;\r\nGO<\/pre>\n<p class=\"caption\">Listing 8: Using the <code>WRITE<\/code> calls to perform a Partial update<\/p>\n<p>Compare the output and you will see the difference (this is just a portion of the <code>RoomDesc<\/code> column value before and after the update):<\/p>\n<p><code>RoomDesc<br \/>\n----------------------------------------------<br \/>\ns out to sleep two.  There is also a fireplace<br \/>\n<\/code><\/p>\n<p><code>RoomDesk<br \/>\n----------------------------------------------<br \/>\ns out which will sleep two.  There is also a f<\/code><\/p>\n<p>The <code>WRITE<\/code> clause cannot be used to update a large data type column to <code>NULL<\/code> value. This can be demonstrated by running the code in Listing 9.<\/p>\n<pre class=\"lang:none theme:none\">UPDATE dbo.Room\r\n   SET RoomDesc.WRITE (NULL,0, LEN(RoomDesc))\r\nWHERE RoomNum = 3;\r\nGO\r\nSELECT * FROM dbo.Room WHERE RoomNum = 3;<\/pre>\n<p class=\"caption\">Listing 9: Trying to set <code>RoomDesc<\/code> to null<\/p>\n<p>When the code is Listing 9 is executed it runs without error. But by reviewing the output of the <code>SELECT<\/code> statement, which can be found Report 1, the <code>RoomNum<\/code> column was set to the empty string, not to a <code>NULL<\/code> value.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"628\" height=\"57\" class=\"wp-image-94914\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2022\/10\/table-description-automatically-generated-with-me.png\" alt=\"Table\n\nDescription automatically generated with medium confidence\" \/><\/p>\n<p><strong>Report 1: Output of <\/strong><code>SELECT<\/code><strong> statement in Listing 9<\/strong><\/p>\n<p>If a large data type column needs it values set to <code>NULL,<\/code> then a standard <code>SET<\/code> clause can be used as in Listing 10.<\/p>\n<pre class=\"lang:none theme:none\">UPDATE Room\r\n   SET RoomDesc = NULL\r\nWHERE RoomNum = 3;\r\nGO\r\nSELECT * FROM dbo.Room WHERE RoomNum = 3;<\/pre>\n<p class=\"caption\">Listing 10: Setting a large data type column to null.<\/p>\n<p>The output shown in Report 2 was created when the code in Listing 10 was executed.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"619\" height=\"47\" class=\"wp-image-94915\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2022\/10\/word-image-29.png\" \/><\/p>\n<p><strong>Report 2: Output from Listing 10.<\/strong><\/p>\n<p>In Report 2 the column value for the <code>RoomDesc<\/code> column is now set to NULL.<\/p>\n<h2>Using the TOP Clause<\/h2>\n<p>The <code>TOP<\/code> clause can be used to limit the number of rows being updated. This can be demonstrated by using the code in Listing 11.<\/p>\n<pre class=\"lang:none theme:none\">USE tempdb;\r\nGO\r\nUPDATE TOP (2) dbo.Room\r\n   SET PriceChangeDateTime = SYSDATETIME();\r\nSELECT * FROM Room;\r\nGO<\/pre>\n<p class=\"caption\">Listing 11: Using the TOP clause to limit the number of rows being updated<\/p>\n<p>The table <code>Room<\/code> only has 3 rows of data. When the code is listing 9 is run only the first two rows will be update. This can be seen by revieing the <code>PriceChangeDateTime<\/code> column values on the three different rows in the output in Report 3.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1315\" height=\"149\" class=\"wp-image-94916\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2022\/10\/word-image-30.png\" \/><\/p>\n<p><strong>Report 3: Output when Listing 11 was executed<\/strong><\/p>\n<p>In Report 3 only the first two rows have updated the <code>PriceChangeDateTime<\/code> column values. The \u201c<code>TOP (2)<\/code>\u201d clause in Listing 11 restricted the third row from getting a new datetime stamp value.<\/p>\n<h2>Concerns with using the UDPATE statement<\/h2>\n<p>Here is a list of a few concerns that might arise when issuing an <code>UPDATE<\/code> command:<\/p>\n<ul>\n<li>Forgetting to add a <code>WHERE<\/code> constraint to an <code>UPDATE<\/code> statement when only a subset of rows needs to be updated. By leaving off the <code>WHERE<\/code> clause causes all rows in the target table will be updated. (This is a common database programmer error to think an entire statement is highlighted, but miss the <code>WHERE<\/code> clause. An all too common mistake.)<\/li>\n<li>Having an incorrect <code>WHERE<\/code> clause. When a <code>WHERE<\/code> clause is not correct, either no rows will be updated, or the wrong rows will be updated.<\/li>\n<\/ul>\n<p>There are a couple of different techniques that can be used to avoid these two issues.<\/p>\n<p>The first one is to take a database\/transaction log backup prior to running an untested <code>UPDATE<\/code> statement. By having a backup, you have a recovery point should a <code>UPDATE<\/code> statement update rows that should have been updated. Even though this method technically works, it might not be the most elegant solution to resolving a poorly coded <code>UPDATE<\/code> statement. It also is not ideal in a very active table where other writes are happening concurrently.<\/p>\n<p>Another method is to first write a <code>SELECT<\/code> statement using the newly coded <code>WHERE<\/code> clause. By using a <code>SELECT<\/code> statement you can verify the correct rows are return. If the wrong rows are displayed, then no problem. Just modify the <code>SELECT<\/code> statement until the correct <code>WHERE<\/code> statement is coded, and the correct set of rows are displayed. Once the correct <code>WHERE<\/code> statement has been generated, change the <code>SELECT<\/code> statement to an <code>UPDATE<\/code> statement.<\/p>\n<p>The last method (and one of the best methods when writing scripts to modify a production system) is to wrap the <code>UPDATE<\/code> statement inside a transaction. First issue a <code>BEGIN TRANACTION<\/code>, then make your changes. By doing this the <code>UPDATE<\/code> statement can be rolled back if it updated the rows or values incorrectly. Just be aware that uncommitted changes can block other users depending on how your server and databases are configured.<\/p>\n<h2>Updating data using a view<\/h2>\n<p>Updating data accessing a view can be a very useful tool. Using a view, you are able to enforce criteria on the user by embedding it in the view. Using the <code>WITH CHECK OPTION<\/code>, you can ensure that users can only modify (or insert) data that they can see based on any filtering of rows in the view. You can read more about view objects <a href=\"https:\/\/learn.microsoft.com\/sql\/t-sql\/statements\/create-view-transact-sql\">in the Microsoft documentation<\/a>.<\/p>\n<p>The important thing to understand for this article is that you can only modify one table object\u2019s data at a time. For example, in listing 12 I will create a view that references <code>dbo.Room<\/code> and <code>dbo.PriceChanges<\/code>.<\/p>\n<pre class=\"lang:none theme:none\">CREATE VIEW dbo.v_room\r\nAS\r\nSELECT Room.RoomNum,\r\n       Room.Beds,\r\n       Room.Sleeps,\r\n       Room.StandardRate,\r\n       Room.PriceChangeDateTime,\r\n       Room.RoomDesc,\r\n       PriceChanges.NewStandardRate\r\nFROM   dbo.Room\r\n\t\tJOIN dbo.PriceChanges\r\n\t\t\tON Room.RoomNum = PriceChanges.RoomNum;<\/pre>\n<p class=\"caption\">Listing 12: View that references multiple tables<\/p>\n<p>One of the nice things about view objects is that they hide the implementation details from the user. However, if a user wrote the query as shown in Listing 13, they will get a confusing error message:<\/p>\n<pre class=\"lang:none theme:none\">UPDATE dbo.v_room\r\n   SET Beds = 100,\r\n       NewStandardRate = 1000\r\nWHERE  RoomNum = 1;<\/pre>\n<p class=\"caption\">Listing 13: Update that references multiple tables in the same query<\/p>\n<p>The error output is:<\/p>\n<p><code>View or function 'dbo.v_room' is not updatable because the modification affects multiple base tables.<\/code><\/p>\n<p>To use the view in this particular update scenario, you need to use the code from listing 14:<\/p>\n<pre class=\"lang:none theme:none\">UPDATE dbo.v_room\r\n  SET Beds = 100\r\nWHERE  RoomNum = 1;\r\n\r\nUPDATE dbo.v_room\r\n   SET NewStandardRate = 1000\r\nWHERE  RoomNum = 1;<\/pre>\n<p>This works fine.<\/p>\n<p><strong>Note<\/strong>: While it is beyond the scope of this article, you can make any view editable using an instead of trigger object. For more details, go to the documentation for <a href=\"https:\/\/learn.microsoft.com\/sql\/t-sql\/statements\/create-trigger-transact-sql\">CREATE TRIGGER<\/a>.<\/p>\n<h2>Changing Data with the Basic UPDATE statement<\/h2>\n<p>The primary method to maintain existing data in a table as it changes over time is to use the <code>UPDATE<\/code> statement. An <code>UPDATE<\/code> statement can update a single column on a single row, or multiple columns on one or more rows. The values used to update a column value can be provided as a scalar expression or can come from column values in another table.<\/p>\n<p>Care needs to be taken when writing <code>UPDATE<\/code> statements. A badly formed <code>UPDATE<\/code> statement might update all rows in an entire table, or an incorrect set of rows. Therefore, make sure all <code>UPDATE<\/code> statements are fully tested prior to running them against your production database. Understanding the basic <code>UPDATE<\/code> statement is critical in making sure accurate <code>UPDATE<\/code> statement are written and performed, to maintain database records, as their column values changed over time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once data is inserted into a table, data typically needs to be maintained as time goes on. To make changes to an existing row or a number of rows, in a table, the UPDATE statement is used. This article shows how to use the UPDATE statement to modify data within a SQL Server table. Syntax&#8230;&hellip;<\/p>\n","protected":false},"author":78478,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[53,143525,143531],"tags":[],"coauthors":[11330],"class_list":["post-94913","post","type-post","status-publish","format-standard","hentry","category-featured","category-learn","category-t-sql-programming-sql-server"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/94913","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\/78478"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=94913"}],"version-history":[{"count":3,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/94913\/revisions"}],"predecessor-version":[{"id":94922,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/94913\/revisions\/94922"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=94913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=94913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=94913"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=94913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}