Multiple Value Insert In A Single Query


Hello readers, Below is the query to inset multiple values in a Table name items in a single INSERT statement.

First Create a table

CREATE TABLE items(id INT, itemname VARCHAR(30))
GO

Inserting values to items table

INSERT INTO items(id,itemname) VALUES (1, 'Pen'),(2,'Pencil'),(3,'Rubber'),(1,'Scale'),(1,'Copy'),
(3,'Box'),(2,'Compas'),(4,'Stapler'),(5,'Paper'),(6,'Ink')

GO

SELECT * FROM items


Query is simple. Not too complicated.

Just add new values after first by placing comma , and type next values.


Comments

  1. can u plz post the code for Image uploader.. which store Image Path in DB and shows directly on the form(In Image Control)
    Thanx

    ReplyDelete
  2. Topic added to blog with name File Upload under Asp.Net Tips.

    ReplyDelete

Post a Comment

Popular posts from this blog

Get Query String Values With Javascript

Change Css Class of li in ul onclick

Change Text Color with Javascript