CREATE TABLE schema_name.table_name (
ID_column INT NOT NULL IDENTITY(1,1) PRIMARY KEY,
column_1 data_type NOT NULL,
column_2 data_type
);
CREATE TABLE [database_name.][schema_name.]table_name (
pk_column data_type PRIMARY KEY,
column_1 data_type NOT NULL,
column_2 data_type,
...,
table_constraints
);
--****************** For More help, visit NAYCode.com
CREATE TABLE [table_name]
(
Col1 [datatype],
Col2 [datatype]
CONSTRAINT [PK_Name] PRIMARY KEY CLUSTERED
(
[Col1] ASC
)
)
-- ********************** For more tutorial - Visit NAYCode.com
CREATE TABLE [dbo].[Customers](
[Cust_Id] [int] NOT NULL,
[Cust_Name] [nvarchar](50) NULL,
[Cust_Address] [nvarchar](100) NULL,
[Cust_Phone] [nvarchar](50) NULL,
[Cust_DOB] [datetime] NULL,
CONSTRAINT [PK_Customers] PRIMARY KEY CLUSTERED
(
[Cust_Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO