Search
 
SCRIPT & CODE EXAMPLE
 

SQL

create table sql server

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 
);
Comment

create table in microsoft sql server

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
);
Comment

Create table Statement Syntax in SQL Server

--****************** For More help, visit NAYCode.com
CREATE TABLE [table_name]
(
  Col1 [datatype],
  Col2 [datatype]
  CONSTRAINT [PK_Name] PRIMARY KEY CLUSTERED 
  (
	[Col1] ASC
  )
)
Comment

Create table in SQL Server

-- ********************** 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
Comment

PREVIOUS NEXT
Code Example
Sql :: how to login sql server using cmd 
Sql :: How to convert DateTime to VarChar SQL 
Sql :: mysql create view full table 
Sql :: add column text sql after column 
Sql :: pad zero sql server 
Sql :: sql function 
Sql :: alter table id autoincrement 
Sql :: sql server output parameter 
Sql :: select first and last row sql 
Sql :: sql compare strings 
Sql :: join in update query in mysql 
Sql :: sql pagination 
Sql :: select last 30 days sql 
Sql :: mysql between 
Sql :: sql date format 
Sql :: xampp import sql file command line 
Sql :: how to generate a unique random number in mysql 
Sql :: mysql delete duplicate rows but keep one 
Sql :: view databases in mysql 
Sql :: sql convert float to string 
Sql :: add colum date in sql 
Sql :: how to inner join 4 tables in sql 
Sql :: mysql update column to be nullable 
Sql :: mysql like case sensitive 
Sql :: postgresql not case sensitive where in 
Sql :: failed to connect to mysql at localhost:3306 with user root 
Sql :: insert array postgresql 
Sql :: postgres update with if condition query 
Sql :: how to load files in mysql 
Sql :: Cannot insert explicit value for identity column in table when IDENTITY_INSERT is set to OFF 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =