Locked lesson.
About this lesson
We will add data to our Table
Quick reference
Adding Data to a Table
Let's add some data to our Table.
When to use
There are several ways to add data to a table. We'll use SSMS to do it right now.
Instructions
To add data manually using SSMS, find your table in the object explorer, right click it and select "Edit Top 200 Rows".
Then just manually type in the information you want to add.
Hints & tips
- Adding data manually using SSMS is pretty easy!
- Right Click your table in the object explorer, then select "Edit Top 200 Rows"
- 00:05 Okay, so we've created our customer database, and
- 00:08 we built our current customer's table.
- 00:10 Now it's time to add some data to that table.
- 00:12 And before we do that, I just wanna kind of explore around here and look at this.
- 00:16 If we click Expand, we can see this column section.
- 00:20 So if we expand that,
- 00:21 we can see all of the columns that we just created in the last video.
- 00:24 We got first name, last name, e-mail address, phone number, age, and
- 00:28 street address.
- 00:29 And we can also see the data types.
- 00:31 So varchar50, text, text, int, etc.
- 00:36 So we also have all this other stuff.
- 00:38 And this is all stuff you don't care about, you're not gonna use at this point.
- 00:41 So it's nice to be able to just sort of at a glance look at this and
- 00:45 see what your different columns are.
- 00:47 So now we wanna add data to this thing.
- 00:50 How in the world do we do that?
- 00:51 So the easiest way is I just right-click on here and click Edit Top 200 Rows.
- 00:57 And here we have our table.
- 00:58 And you can see each column, First Name, Last Name, Email Address,
- 01:01 Phone Number, Age, and Street Address.
- 01:03 And this little star is where we're at.
- 01:06 Down here it's 1 of 1, talking about the rows there, row one of one.
- 01:10 And we haven't entered anything so it's just null.
- 01:13 Null means nothing.
- 01:14 So if you look at this,
- 01:16 it's starting to look an awful lot like that spreadsheet from a few videos ago.
- 01:20 So we can just type in, and when I tabbed over,
- 01:22 that's how you move from field to field here, you tab on your keyboard or
- 01:26 you can click your, you can click it with the mouse button.
- 01:29 But you're generally gonna wanna tab.
- 01:31 But we got this little thing here, and if you hover over it,
- 01:34 it says the cell has changed but the data has not been saved basically.
- 01:38 So until you fill out all of these and hit Enter and
- 01:41 went to the next row, it's not gonna save it.
- 01:43 So we can hit Escape,
- 01:44 and it goes back to what it was before cuz we haven't saved it yet.
- 01:47 So go ahead and reenter John and Elder, my e-mail address.
- 01:52 JohnE4196@gmail.com.
- 01:56 Phone number, 111-222-3333.
- 02:00 My age is 39.
- 02:02 My street address is Las Vegas.
- 02:06 And we're gonna go back and edit this later.
- 02:08 I'll show you how to do that from street address to city,
- 02:11 just to show you how to edit these things.
- 02:13 But if we get to this last field and hit tab, you see all those exclamation marks
- 02:18 go away cuz it's now been saved, and we go down to our next row.
- 02:21 So we can go Tina Smith.
- 02:26 Tina at smith.com.
- 02:35 So just like that, we can enter all of the information that we want into our table.
- 02:40 And that's really, very, very, very simple.
- 02:43 So if we click Close here, we can come back here to our,
- 02:46 let's see customer database, to our tables, Current Customers.
- 02:52 And click Design.
- 02:54 And we can come back here and edit any of these.
- 02:57 So we wanted to change this to city.
- 03:00 We can go ahead and do that, that.
- 03:01 Do you want to save?
- 03:02 Yes we do. Now if we come back here and
- 03:04 click Edit top 200 rows, we see the street address has changed to city, and
- 03:09 all of the information in the column stays the same.
- 03:11 So it is just that easy to add data to your database with SQL Server 2016.
- 03:16 And we are moving right along.
- 03:18 So in the next video, I'll talk about backing up your database, very important.
- 03:23 As well as importing your database once you've backed it up.
- 03:25 If something goes wrong,
- 03:27 you need to re-import your back-up, I'll show you how to do that in the next video.
Lesson notes are only available for subscribers.