If u want to store any data in Microsoft SQL Server database then u will have to create a table. So to create a table u should to keep a unique name of that table. In a table combination of column and row, each column define in bracket which content what type of data u insert. To creating a table in Microsoft SQL Server by heading syntax CREATE TABLE “table name” statement.
Below is an example to create a table in Microsoft SQL Server name “CUSTOMER” which contain his detail, and in which his fields/data cannot be NULL.
CREATE TABLE CUSTOMERS
ID INT NOT NULL,
NAME VARCHAR (20) NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR (25) ,
SALARY DECIMAL (18, 2),
PRIMARY KEY (ID)
Execute a table.
To execute a table in Microsoft SQL Server, first you will select a query like below
And then press F5 or press the execute button which located in top left in Microsoft SQL Server.
There are two basis ways to insert a data in Microsoft SQL Server table with the help of INSERT INTO syntax. In 1st, u will define the column name while writing the syntax to inserting the data in Microsoft SQL Server.
And in 2nd You will directly put the values in that particular table.
By the select command you can view a column which you have created in Microsoft SQL Server.
Select * from “table name”
select * from customers
How to delete a table from Microsoft SQL Server ?
By the Microsoft SQL Server drop statement you can delete the table along with all the data and command given on that particular table.
But make sure you have to delete the table and all its command; because once you have deleted the table then you’ll not recover the data which were saved in table.
DROP TABLE Customers;
select and press F5 .
- Blogger Comment
- Facebook Comment