Jump to content

Insert multi values into a table


haibec

Recommended Posts

I think what you can do is that first make an array of the things that you want to put into the table and then instead of writing "Something" you can write thatArray .

Link to comment
Share on other sites

I want Insert multi values same same into a table .Please help me
Inserting a record with multiple values is easy:
INSERT INTO	table	(field1, field2, field3)VALUES   (val1a, val1b, val1c)WHERE   condition = @condition;

If you want to insert multiple records, its practically the same thing, except you seperate the values for each record by a comma:

INSERT INTO	table	(field1, field2, field3)VALUES   (val1a, val1b, val1c),   (val2a, val2b, val2c),   (val3a, val3b, val3c),   (val4a, val4b, val4c)WHERE   condition = @condition;

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...