SQL Insert

SQL Insert command is used to insert data into tables. Insert command will insert data in the shape of rows into our table.

SYNTAX:
INSERT INTO tablename (column1, column2, column3) VALUES (‘value1’, ‘value2’, ‘value3’)

EXAMPLE:
INSERT INTO ITEMS_SHAHID4
(ItemName, ItemPrice, ItemCat, ItemDesc)
VALUES
(‘projector’, ‘300’, ‘computers’, ‘I m selling a sony projector. Please please please buy it.’)

DESCRIPTION:
fOR INSERTING DATA INTO TABLES. If a value to be inserted is for a character or datetime data type, it must be enclosed within single quotes. Numbers do not require single quotation.

Example of Insert Command for Ms Sql Server

Insert into Product values
(
          'Epson 2K',
          'Printer',
          100,
          'Enjoy from colour printing'
)

Copy Data from one table into another table 

To copy data between two tables of the same structure use the following statement:

Insert into TableB (field1, field2) select field1, field2 from TableA

SQL Insert

SQL Insert command is used to insert data into tables. Insert command will insert data in the shape of rows into our table.

SYNTAX:
INSERT INTO tablename (column1, column2, column3) VALUES (‘value1’, ‘value2’, ‘value3’)

EXAMPLE:
INSERT INTO ITEMS_SHAHID4
(ItemName, ItemPrice, ItemCat, ItemDesc)
VALUES
(‘projector’, ‘300’, ‘computers’, ‘I m selling a sony projector. Please please please buy it.’)

DESCRIPTION:
fOR INSERTING DATA INTO TABLES. If a value to be inserted is for a character or datetime data type, it must be enclosed within single quotes. Numbers do not require single quotation.

Example of Insert Command for Ms Sql Server

Insert into Product values
(
          'Epson 2K',
          'Printer',
          100,
          'Enjoy from colour printing'
)

Copy Data from one table into another table 

To copy data between two tables of the same structure use the following statement:

Insert into TableB (field1, field2) select field1, field2 from TableA

SQL Insert

SQL Insert command is used to insert data into tables. Insert command will insert data in the shape of rows into our table.

SYNTAX:
INSERT INTO tablename (column1, column2, column3) VALUES (‘value1’, ‘value2’, ‘value3’)

EXAMPLE:
INSERT INTO ITEMS_SHAHID4
(ItemName, ItemPrice, ItemCat, ItemDesc)
VALUES
(‘projector’, ‘300’, ‘computers’, ‘I m selling a sony projector. Please please please buy it.’)

DESCRIPTION:
fOR INSERTING DATA INTO TABLES. If a value to be inserted is for a character or datetime data type, it must be enclosed within single quotes. Numbers do not require single quotation.

Example of Insert Command for Ms Sql Server

Insert into Product values
(
          'Epson 2K',
          'Printer',
          100,
          'Enjoy from colour printing'
)

Copy Data from one table into another table 

To copy data between two tables of the same structure use the following statement:

Insert into TableB (field1, field2) select field1, field2 from TableA