{"id":121,"date":"2017-06-28T15:06:07","date_gmt":"2017-06-28T15:06:07","guid":{"rendered":"http:\/\/www.polysyncronism.com\/wordpress\/?p=121"},"modified":"2017-06-28T18:00:52","modified_gmt":"2017-06-28T18:00:52","slug":"sql-copy-table","status":"publish","type":"post","link":"http:\/\/www.polysyncronism.com\/wordpress\/2017\/06\/28\/sql-copy-table\/","title":{"rendered":"SQL Copy Table"},"content":{"rendered":"<p>I sometimes need to just simply copy a small table to compare it against another run of the same program or some other legitimate reason to copy a table.<\/p>\n<p>This SQL allows creating a new table and populating it with the data from an existing table.<\/p>\n<pre class=\"lang:tsql decode:true \" title=\"SQL to copy a table\" >SELECT *\r\nINTO dbo.mytableTEST01\r\nFROM (select * from mytable) G1<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I sometimes need to just simply copy a small table to compare it against another run of the same program or some other legitimate reason to copy a table. This SQL allows creating a new table and populating it with the data from an existing table. SELECT * INTO dbo.mytableTEST01 FROM (select * from mytable) &hellip; <a href=\"http:\/\/www.polysyncronism.com\/wordpress\/2017\/06\/28\/sql-copy-table\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;SQL Copy Table&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,7],"tags":[],"class_list":["post-121","post","type-post","status-publish","format-standard","hentry","category-code","category-t-sql"],"_links":{"self":[{"href":"http:\/\/www.polysyncronism.com\/wordpress\/wp-json\/wp\/v2\/posts\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.polysyncronism.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.polysyncronism.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.polysyncronism.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.polysyncronism.com\/wordpress\/wp-json\/wp\/v2\/comments?post=121"}],"version-history":[{"count":1,"href":"http:\/\/www.polysyncronism.com\/wordpress\/wp-json\/wp\/v2\/posts\/121\/revisions"}],"predecessor-version":[{"id":122,"href":"http:\/\/www.polysyncronism.com\/wordpress\/wp-json\/wp\/v2\/posts\/121\/revisions\/122"}],"wp:attachment":[{"href":"http:\/\/www.polysyncronism.com\/wordpress\/wp-json\/wp\/v2\/media?parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.polysyncronism.com\/wordpress\/wp-json\/wp\/v2\/categories?post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.polysyncronism.com\/wordpress\/wp-json\/wp\/v2\/tags?post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}