From the course: SQL Server 2008 Essential Training

Unlock the full course today

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

Creating tables

Creating tables - SQL Server Tutorial

From the course: SQL Server 2008 Essential Training

Start my 1-month free trial

Creating tables

To create new tables, we need to drill into the database. We want to add those tables too, then expand the Tables folder and just right-click it and select New Table. Now you would expect to first say what the table is called but in fact your cursor is blinking away now at a column name. That's because it's giving you this temporary title for the table here, Table_1. We will get the chance to change that in just a minute but I'm going to describe a few columns because apparently that's what I have to do here. Let's say what I wanted to do was create a table to hold employee information. So I have got things like employee first name, employee last name, date joined, birth date, phone, that kind of thing. So I'm going to just create a few simple columns here. The first would be FirstName. Again I'm splitting this up into first name and last name rather than just having a whole name. Then when I hit Tab, it gives me a drop-down of Data Type. This is, again, the type of data that this is…

Contents