From the course: Microsoft SQL Server 2016 Essential Training

Unlock the full course today

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

Create a table using T-SQL

Create a table using T-SQL - SQL Server Tutorial

From the course: Microsoft SQL Server 2016 Essential Training

Start my 1-month free trial

Create a table using T-SQL

- [Instructor] Now let's look at using TSQL to create a table. Here in SQL Server Management Studio, I'll open up a New Query and then I'll type in the keyword CREATE and the keyword TABLE, then I need to give the TABLE a name. I'm going to call it Employee. Then in parenthesis, I'll need to list all of the columns. So I'll open the parenthesis. I'll say my first column name will be EmployeeID, and I want that column to be data type integer, so I'll type in int. Then before I type the name of the next column, I need to put a , and my next column will be EmployeeName, and for that, I want to use the data type varchar(50). So that concludes my column names. I'll need to put a ) to signify the end of the columns. And I'm going to add an option here. If I just ran it right now, it would create this on the default Filegroup, but I want to work with a different Filegroup, so I'll say ON Secondary, and Secondary was a Filegroup I created previously. I'll hit the red exclamation point for…

Contents