In this video, database expert Adam Wilbert demonstrates how to insert new records into a table using a T-SQL query in SQL Server 2016 Management Studio. The procedure uses a new clause: INSERT, which requires a listing of the fields, or columns, to be written to, and then a listing of the VALUES that make up the new record.
- [Voiceover] New records can be added to your data tables…using Transact-SQL, using the INSERT keyword.…To use it, we'll specify the columns…that we want to insert data into…and then supply a list of the values.…Let's take a look by first exploring the existing content…in the Sales.SpecialDeals table…inside of the WideWorldImporters database.…I'll right-click on it and choose Select Top 1000 Rows.…What I want to do is add in a third record…to this table that will correspond to a 25% sale…that will occur during the month of October.…I'll need to specify new data for the Special ID column,…and add a deal description, as well as a start and end date…for the promotion, and if I scroll over here…to the far right, I'll want to supply data…for the DiscountPercentage…as well as the LastEditedBy and LastEditedWhen fields.…
So to begin the process, we'll come up…to the New Query button on the Standard Toolbar,…and we'll start typing in our INSERT statement.…You'll start with the keyword INSERT,…and we're actually inserting data,…
This course introduces the most important features of SQL Server 2016, and is designed to act as the student's very first look at how the server operates. Adam Wilbert shows how to install a local copy of SQL Server; demonstrates the working environment, SQL Server Management Studio; and walks students through their first hour creating tables, defining relationships, and writing and running queries with Transact-SQL commands. Everything you need to accomplish to create your first database is covered in just 80 minutes. Start watching to get up and running with this professional-grade database management system.
- What is SQL Server?
- Configuring the server
- Creating a new database and data tables
- Joining tables with keys
- Creating a SELECT statement
- Writing an UPDATE statement
- Adding data with the INSERT statement