How do you create a table in Microsoft SQL Server database?

Experience Level: Junior
Tags: DatabasesQuality Assurance (QA)

Answer

There are two basic options:

Using SSMS designer

  • Connect to the SQL Server instance
  • Go to the Database and expand its node in Object Explorer
  • Right click the node Tables and select New-Table
  • Define the columns and their data types
  • Click Save

Writing and executing SQL script using SSMS query window

  • Connect to the SQL Server instance
  • Go to the Database and expand its node in Object Explorer
  • Click the New Query to open the query window
  • Enter the SQL script for creating the table and execute it
Query
CREATE TABLE People (
	Id int,
	FirstName nvarchar(20),
	LastName nvarchar(20)
)

Comments

No Comments Yet.
Be the first to tell us what you think.
MS SQL Server for Testers
MS SQL Server for Testers

Are you learning Databases ? Try our test we designed to help you progress faster.

Test yourself

Chat

Oh, the operator is not available. Leave us your comments. We will answer all your questions as soon as possible.

Comments

Anonymous
Καλησπέρα.
Anonymous
the infinteis -3/15 so 1triition / infinet
Anonymous
e
Anonymous
<a href="https://inspirum.pl "
Anonymous
[url]https://inspirum.pl[/url]
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e