Microsoft SQL Server INSERT from SELECT Query Results


Example

To insert data retrieved from SQL query (single or multiple rows)

INSERT INTO Table_name (FirstName, LastName, Position)
SELECT FirstName, LastName, 'student' FROM Another_table_name

Note, 'student' in SELECT is a string constant that will be inserted in each row.

If required, you can select and insert data from/into the same table