{"id":9355,"date":"2022-06-16T06:41:00","date_gmt":"2022-06-16T04:41:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=9355"},"modified":"2026-03-08T18:10:45","modified_gmt":"2026-03-08T17:10:45","slug":"sql-server-insert-into-from-a-select","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/","title":{"rendered":"SQL Server Insert Into from a SELECT Query"},"content":{"rendered":"\n<p class=\"has-text-align-center\"><em><strong>With SQL Server, how to load data into a table using an insert into query directly from a Select ? <\/strong><\/em><\/p>\n\n\n\n<p>There are 3 solutions to run an INSERT INTO query within a SQL Select. The first solution is to insert directly the data with a SELECT query just after the INSERT INTO keyword. Then, the second solution is to use a SELECT with a UNION ALL to group several rows into a single insert statement. And last but not least, the third one uses a SELECT that retrieves data from another table.<\/p>\n\n\n\n<p>In this article with different examples, we are using the same source table.<\/p>\n\n\n\n<div class=\"wp-block-yoast-seo-table-of-contents yoast-table-of-contents\"><h2>Contents<\/h2><ul><li><a href=\"#h-create-the-sample-sql-table-before-the-insert-into-select\" data-level=\"2\">Create the sample SQL table before the INSERT INTO SELECT<\/a><\/li><li><a href=\"#h-solution-1-use-an-insert-into-select-type-query-multiple-times\" data-level=\"2\">Solution 1 : Use an INSERT INTO SELECT type query multiple times<\/a><\/li><li><a href=\"#h-solution-2-sql-server-insert-into-with-multiple-select-and-union-all\" data-level=\"2\">Solution 2 : SQL Server INSERT INTO with multiple select and UNION ALL<\/a><\/li><li><a href=\"#h-solution-3-sql-server-insert-into-from-another-table-s-select\" data-level=\"2\">Solution 3 : SQL Server INSERT INTO From Another Table&#8217;s SELECT<\/a><\/li><li><a href=\"#h-conclusion-on-simple-solutions-to-insert-data-from-selects\" data-level=\"2\">Conclusion on simple solutions to insert data from Selects<\/a><\/li><\/ul><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-create-the-sample-sql-table-before-the-insert-into-select\">Create the sample SQL table before the INSERT INTO SELECT<\/h2>\n\n\n\n<p>The very first step, of course, is to create a test table. We&#8217;ll use it in our 3 example queries. <\/p>\n\n\n\n<p>To go aheaed, just copy and paste the script into <a href=\"https:\/\/expert-only.com\/en\/ssms\/download-ssms-18\/\">SQL Server Management Studio<\/a>. Of course you will have to adapt the queries to your specific needs before running them on your environement. First simply reuse the logic and the example that suits you the most.<\/p>\n\n\n\n<p>To create the empty Customers table, run the queries below which is the target table.<\/p>\n\n\n\n<p><strong><em>Delete the Customers if it exists in your database. Use a development or sandbox database of course!<\/em><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">IF EXISTS( \n\tSELECT 1 FROM sys.objects \n\tWHERE object_id = object_id(N'[dbo].[Customers]') \n\t\tAND type in (N'U') )\nDROP TABLE [dbo].[Customers];\nGO\n<\/pre>\n\n\n\n<p>For further examples of <a href=\"https:\/\/expert-only.com\/en\/t-sql\/insert-data-from-a-sql-server-procedure\/\">SQL Server insert using a procedure this time, click here<\/a>.<\/p>\n\n\n\n<p><strong><em>Create the Customers table using this code<\/em><\/strong><\/p>\n\n\n\n<p>The Id_Customer is auto incremented to have a rolling list of customer numbers.<\/p>\n\n\n\n<p>And the Name column is declared as unique, it means that you cannot enter 2 times the same name in this column. In other words, it is not possible to have duplicates on the Customers Name column.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">CREATE TABLE [dbo].[Customers] (\n\t[Id_Customer] int IDENTITY(1,1),\n\t[Name] nvarchar(20) UNIQUE,\n\t[City] nvarchar(20)\n);\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-solution-1-use-an-insert-into-select-type-query-multiple-times\">Solution 1 : Use an INSERT INTO SELECT type query multiple times<\/h2>\n\n\n\n<p>The first DML (Data Manipulation Language) solution is the simplest and most common one to implement. Especially if you are familiar with editing several rows in columns, with Excel for example. And for limited number of lines. other wise you will need to genarate multiple independant insert statements.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">INSERT INTO dbo.Customers ( Name, City ) SELECT N'MAMMADOU', 'Zurich';\nINSERT INTO dbo.Customers ( Name, City ) SELECT N'SERGEI', 'Ushuaia';\nINSERT INTO dbo.Customers ( Name, City ) SELECT N'KARIM', 'Casablanca';\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-solution-2-sql-server-insert-into-with-multiple-select-and-union-all\">Solution 2 : SQL Server INSERT INTO with multiple select and UNION ALL<\/h2>\n\n\n\n<p>This solution also makes it easy to read the inserted data because it comes from a simple selection combined with Union All statements. Of course it can also comes from select queries that are not hard coded.<\/p>\n\n\n\n<p><strong><em>Empty the table using a TRUNCATE TABLE first.<\/em><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">INSERT INTO dbo.Customers ( Name, City )\n\tSELECT N'MR MAMMADOU', 'Zurich'   UNION ALL\n\tSELECT N'MR SERGEI', 'Ushuaia'    UNION ALL\n\tSELECT N'MR KARIM', 'Casablanca';<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-solution-3-sql-server-insert-into-from-another-table-s-select\">Solution 3 : SQL Server INSERT INTO From Another Table&#8217;s SELECT<\/h2>\n\n\n\n<p>This time, let&#8217;s dd the suffix &#8220;-Junior&#8221; to differentiate the newly inserted rows from the previous ones. Indeed, we must do this to allow insertion without error, because of the Uniqueness constraint added on the Name column.<\/p>\n\n\n\n<p>We simply insert from the same table, so the source and the target are the same unique table : Customers.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">INSERT INTO dbo.Customers (Name, City)\n\tSELECT \tNAME + '-Junior', City\n\tFROM \tdbo.Customers;\n<\/pre>\n\n\n\n<p>Finally, you can check all rows, i.e. 3 rows already present from step 2 and 3 new rows of data inserted. The Customers lines inserted into the target table are visible using a simple Select <a href=\"https:\/\/www.dictionary.com\/browse\/query\" target=\"_blank\" rel=\"noreferrer noopener\">query<\/a>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT *\nFROM   dbo.Customers;\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion-on-simple-solutions-to-insert-data-from-selects\">Conclusion on simple solutions to insert data from Selects<\/h2>\n\n\n\n<p>To conclude, multiple technical solutions exist in SQL Server to enrich tables and to copy data, using hard coded insert statements or select queries from other tables.<\/p>\n\n\n\n<p>Of course those 3 examples use only 3 lines of data and are simple, on purpose. But when dealing with large amounts of data or complex transformations, those queries can be very useful.<\/p>\n\n\n\n<p>On a different topic, link to table storage, the T-SQL language also allows you to <a href=\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-size-of-all-tables-in-sql-server\/\"><strong>display the full list of the tables size and space available in a database<\/strong><\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-wp-embed is-provider-sql-and-it-tutorials wp-block-embed-sql-and-it-tutorials\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"llmCW8iOmX\"><a href=\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-size-of-all-tables-in-sql-server\/\">How to Get the Size of all Tables in SQL Server ?<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;How to Get the Size of all Tables in SQL Server ?&#8221; &#8212; SQL and IT Tutorials\" src=\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-size-of-all-tables-in-sql-server\/embed\/#?secret=TCip9CEmI7#?secret=llmCW8iOmX\" data-secret=\"llmCW8iOmX\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>With SQL Server, how to load data into a table using an insert into query directly from a Select ? There are 3 solutions to run an INSERT INTO query within a SQL Select. The first solution is to <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/\" title=\"SQL Server Insert Into from a SELECT Query\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":6010,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[454],"tags":[],"class_list":{"0":"post-9355","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-t-sql"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.7 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQL Server Insert Into from a SELECT Query - T-SQL<\/title>\n<meta name=\"description\" content=\"SQL Server insert into query from a select statement with 3 simple SQL example scripts and the create table associated.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server Insert Into from a SELECT Query\" \/>\n<meta property=\"og:description\" content=\"SQL Server insert into query from a select statement with 3 simple SQL example scripts and the create table associated.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL and IT Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-16T04:41:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-08T17:10:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/07\/new-york-A688BC5521C_1920x1080.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Expert-Only\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@expert_only\" \/>\n<meta name=\"twitter:site\" content=\"@expert_only\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Expert-Only\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"SQL Server Insert Into from a SELECT Query\",\"datePublished\":\"2022-06-16T04:41:00+00:00\",\"dateModified\":\"2026-03-08T17:10:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/\"},\"wordCount\":658,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/07\/new-york-A688BC5521C_1920x1080.jpeg\",\"articleSection\":[\"T-SQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#respond\"]}],\"accessibilityFeature\":[\"tableOfContents\"]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/\",\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/\",\"name\":\"SQL Server Insert Into from a SELECT Query - T-SQL\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/07\/new-york-A688BC5521C_1920x1080.jpeg\",\"datePublished\":\"2022-06-16T04:41:00+00:00\",\"dateModified\":\"2026-03-08T17:10:45+00:00\",\"description\":\"SQL Server insert into query from a select statement with 3 simple SQL example scripts and the create table associated.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/07\/new-york-A688BC5521C_1920x1080.jpeg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/07\/new-york-A688BC5521C_1920x1080.jpeg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server Insert Into from a SELECT Query\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/expert-only.com\/en\/#website\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"name\":\"SQL and IT Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/expert-only.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/expert-only.com\/en\/#organization\",\"name\":\"Expert-Only\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"width\":381,\"height\":174,\"caption\":\"Expert-Only\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\",\"https:\/\/x.com\/expert_only\",\"https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\",\"name\":\"Expert-Only\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"caption\":\"Expert-Only\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL Server Insert Into from a SELECT Query - T-SQL","description":"SQL Server insert into query from a select statement with 3 simple SQL example scripts and the create table associated.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server Insert Into from a SELECT Query","og_description":"SQL Server insert into query from a select statement with 3 simple SQL example scripts and the create table associated.","og_url":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2022-06-16T04:41:00+00:00","article_modified_time":"2026-03-08T17:10:45+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/07\/new-york-A688BC5521C_1920x1080.jpeg","type":"image\/jpeg"}],"author":"Expert-Only","twitter_card":"summary_large_image","twitter_creator":"@expert_only","twitter_site":"@expert_only","twitter_misc":{"Written by":"Expert-Only","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"SQL Server Insert Into from a SELECT Query","datePublished":"2022-06-16T04:41:00+00:00","dateModified":"2026-03-08T17:10:45+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/"},"wordCount":658,"commentCount":0,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/07\/new-york-A688BC5521C_1920x1080.jpeg","articleSection":["T-SQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#respond"]}],"accessibilityFeature":["tableOfContents"]},{"@type":"WebPage","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/","url":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/","name":"SQL Server Insert Into from a SELECT Query - T-SQL","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/07\/new-york-A688BC5521C_1920x1080.jpeg","datePublished":"2022-06-16T04:41:00+00:00","dateModified":"2026-03-08T17:10:45+00:00","description":"SQL Server insert into query from a select statement with 3 simple SQL example scripts and the create table associated.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/07\/new-york-A688BC5521C_1920x1080.jpeg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/07\/new-york-A688BC5521C_1920x1080.jpeg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-insert-into-from-a-select\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"SQL Server Insert Into from a SELECT Query"}]},{"@type":"WebSite","@id":"https:\/\/expert-only.com\/en\/#website","url":"https:\/\/expert-only.com\/en\/","name":"SQL and IT Tutorials","description":"","publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/expert-only.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/expert-only.com\/en\/#organization","name":"Expert-Only","url":"https:\/\/expert-only.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","width":381,"height":174,"caption":"Expert-Only"},"image":{"@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ExpertOnlyCom\/","https:\/\/x.com\/expert_only","https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA"]},{"@type":"Person","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef","name":"Expert-Only","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","caption":"Expert-Only"}}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/9355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/comments?post=9355"}],"version-history":[{"count":5,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/9355\/revisions"}],"predecessor-version":[{"id":31071,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/9355\/revisions\/31071"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/6010"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=9355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=9355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=9355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}