{"id":700,"date":"2011-01-28T20:20:36","date_gmt":"2011-01-29T01:20:36","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=700"},"modified":"2021-03-10T19:21:00","modified_gmt":"2021-03-11T00:21:00","slug":"update-columns-in-database","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/ms-sql-server\/update-columns-in-database\/","title":{"rendered":"Update Columns in Database"},"content":{"rendered":"<p>It&#8217;s pretty common to want to update a column (or several columns) in one table with the value(s) from another table.  Here is how to do it:<\/p>\n<pre name=\"code\" class=\"VB\">UPDATE\n    Table\nSET\n    Table.col1 = other_table.col1,\n    Table.col2 = other_table.col2\nFROM\n    Table\nINNER JOIN\n    other_table\nON\n    Table.id = other_table.id \nWHERE ...<\/pre>\n<p>The structure of this syntax is always something I get mixed up when I want to do this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s pretty common to want to update a column (or several columns) in one table with the value(s) from another table. Here is how to do it: UPDATE Table SET Table.col1 = other_table.col1, Table.col2 = other_table.col2 FROM Table INNER JOIN other_table ON Table.id = other_table.id WHERE &#8230; The structure of this syntax is always something&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[8,43,10,25],"tags":[44,16,83,15],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/700"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=700"}],"version-history":[{"count":4,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/700\/revisions"}],"predecessor-version":[{"id":1921,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/700\/revisions\/1921"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}