557 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Using SELECT INTO and INSERT to insert SQL rows
Part one of a four-part series of blogs
There are various ways to insert data into new or existing tables in T-SQL - this blog gives examples of each.
A previous blog showed how to create tables using SQL - this one shows how to populate them with data.
When I was first learning SQL, these were some of the commands that I found the hardest to remember. The problem is that there are 3 ways to do this, and each does a different thing. The 3 ways are:
|Method||What it does|
|INSERT INTO ... VALUES||Inserts a single record into a table.|
|INSERT INTO ... SELECT||Adds a set of rows into a table.|
|SELECT ... INTO||Creates a new tables from a set of rows.|
Aficionados (aficionadi?) of Access should note that the above methods correspond to append and make-table queries.
This blog will consider each of the 3 methods shown above in turn!
|Parts of this blog|
25 Aytoun Street