Thursday, 19 December 2013

How to create table in sql server / Table creation in sql server

Posted on 08:13 in
Introduction:
This article is helps to create new table using sql server in 2008/2008 R2.
Now create new table for our own way
Method 1:
Syntax:
CREATE TABLE TABLENAME(
COLUMNNAME1 DATATYPE(SIZE),
COLUMNNAME2 DATATYPE(SIZE),
…)
Example:
CREATE TABLE STUDENTDETAILS(
ID INT,
NAME VARCHAR(20),
GENDER VARCHAR(5),
DEPARTMENT VARCHAR(50)
)

Method 2:
Step1:
Expand DatabaseàTable àRight ClickàNew Table



Step2:
Enter Column name and data type (example INT, VARCHAR, DATETIME etc..,) and size.

Step3:
Press Ctrl+Sà Enter table nameàClick Ok
Step4:

Table can be created

0 comments:

Post a Comment