Search This Blog

Thursday, June 27, 2013

CREATE TABLE SQL Server

SQL Server SQL Statements > CREATE TABLE

CREATE TABLE statement creates a table in a database.

Syntax

CREATE TABLE table_name
(
   column_name data_type(size),
   ...
);

Example

CREATE TABLE [dbo].[Table1](
       [ID] [bigint] IDENTITY(1,1) NOT NULL,
       [Name] [nvarchar](50) NOT NULL,
       [Password] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_users1] PRIMARY KEY CLUSTERED
(
       [ID] ASC
)
) ON [PRIMARY]
GO