Overview
Since we have already mentioned the SELECT command in this INSERT tutorial, let’s see how to use the SELECT command to create a new table and populate with data from an existing table.
Explanation
In this example we are creating a new table called dbo.CustomerEmailAddress with only the CustomerID and EmailAddress from the dbo.Customer table. See the code below.
— 1 – Populate the dbo.CustomerEmailAddress table
SELECT CustomerID, EmailAddress
INTO dbo.CustomerEmailAddress
FROM dbo.Customer;
GO
— 2 – Verify the data in the dbo.CustomerEmailAddress table
SELECT *
FROM dbo.CustomerEmailAddress;
GO

Jeremy Kadlec is a Founder, Editor and Author at MSSQLTips.com with more than 300 contributions and 25+ years of SQL Server experience. Jeremy leads a team of more than 300 authors helping millions of SQL Server professionals around the globe every second of the day for the last 20 years. He is also the CTO @ Edgewood Solutions and a six-time SQL Server MVP based on his community contributions. Jeremy brings 25+ years of SQL Server DBA and Developer knowledge to the community and holds a bachelor’s degree from SSU and master’s degree from UMBC.


