From the course: SQL Server 2014 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

INSERT statements

INSERT statements - SQL Server Tutorial

From the course: SQL Server 2014 Essential Training

Start my 1-month free trial

INSERT statements

- In this section, I'd like to talk about using SQL to create a new record in an existing table. We're going to do this by executing the Insert command. Insert will create one new record in an existing table. For this example I'd like to work with the HumanResources.Department table, it's just a little simpler than some of the previous tables we worked with. I'll open up a New Query and I'll do a SELECT * FROM HumanResources.Department just so we can kind of look at the data and see what we're getting ourselves into. When we execute that, we see the table has four fields, DepartmentID, Name, GroupName and ModifiedDate, so all pretty straightforward columns. Now I'll open up a New Query and in the New Query I want to create the Insert statement. I'll type in the keyword INSERT INTO with a space in between, INSERT INTO. Then the name of the table I would like to insert into, which in this case is HumanResources.Department. Then I'll need to list out all of the fields that I'm going to…

Contents