473,485 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Insert Multiple Rows

7 New Member
Hi All

I have the following query in a vb program that inserts multiple rows in a table. The database resides on a server running SQL Server 2005.

Expand|Select|Wrap|Line Numbers
  1. Insert into TableX values (val1,val2,val3),(val1,val2,val3),(val1,val2,val3),(etc)
It processes about 12 rows and then I get the error.
Run-time error '-2147217900 (80040e14)':
Incorrect syntax near ',' .

Any help would be appreciated.
Thanks
Nov 5 '07 #1
4 3014
Jim Doherty
897 Recognized Expert Contributor
Hi All

I have the following query in a vb program that inserts multiple rows in a table. The database resides on a server running SQL Server 2005.

Expand|Select|Wrap|Line Numbers
  1. Insert into TableX values (val1,val2,val3),(val1,val2,val3),(val1,val2,val3),(etc)
It processes about 12 rows and then I get the error.
Run-time error '-2147217900 (80040e14)':
Incorrect syntax near ',' .

Any help would be appreciated.
Thanks
Can you post the 'fullness' of that insert SQL in its proper form as you have it exactly please?

Jim :)
Nov 5 '07 #2
iburyak
1,017 Recognized Expert Top Contributor
It is incorrect syntax and I don’t think it even processes one row.
Correct syntax should be something like this:

Expand|Select|Wrap|Line Numbers
  1. 1.    Insert into TableX values (val1,val2,val3)
  2. 2.    Insert into TableX values (val1,val2,val3)
  3. 3.    Insert into TableX values (val1,val2,val3)  
  4. 4.    (etc)
  5.  
  6.  

Good Luck
Nov 6 '07 #3
Jim Doherty
897 Recognized Expert Contributor
It is incorrect syntax and I don’t think it even processes one row.
Correct syntax should be something like this:

Expand|Select|Wrap|Line Numbers
  1. 1.    Insert into TableX values (val1,val2,val3)
  2. 2.    Insert into TableX values (val1,val2,val3)
  3. 3.    Insert into TableX values (val1,val2,val3) 
  4. 4.    (etc)
  5.  
  6.  

Good Luck
Yes thats my thoughts too I thought maybe rocketfuel had pasted wrongly or got the mouse jitters or something

Jim :)
Nov 6 '07 #4
Rocketfuel
7 New Member
Yes thats my thoughts too I thought maybe rocketfuel had pasted wrongly or got the mouse jitters or something

Jim :)
I apologise, blame it on mouse jitters. I had to changed a program to output to SQL Server instead of DB2(current). Tangled up the SQL. I got it to work just now.
Thanks Jim
Thanks iburyak
Nov 6 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
33281
by: RotterdamStudents | last post by:
Hello there, i have a strange problem. I can't get php to insert multiple rows at once in a MySQL database. I use the $sql = "INSERT INTO database (a,b,c,d,e) VALUES ('$a', '$b' ,'$c', '$d',...
8
5501
by: Sans Spam | last post by:
Greetings! I have a table that contains all of the function permissions within a given application. These functions are different sections of a site and each has its own permissions (READ, WRITE,...
1
26452
by: Tuhin Kumar | last post by:
Hi, I would like to know how to insert multiple rows into a table, using a single INSERT statement. My requirement is like this I have a table ABC which contains multiple employees entries with...
4
5118
by: fip | last post by:
Hi, On DB2 7.1.2 on MVS OS 390, when I tried to do an insert with multiple row contents in the values clause: insert into table11 values('aaaa', 'fa'), ('bbbb', 'fb') I got the error: ...
5
7011
by: SSP | last post by:
Dear ASP.NETers, How would I insert multiple rows of data from a web form? Are there any tute's and stuff around. Couldn't find any myself. Thanks in advance. SSP
20
18304
by: Mark Harrison | last post by:
So I have some data that I want to put into a table. If the row already exists (as defined by the primary key), I would like to update the row. Otherwise, I would like to insert the row. I've...
2
3670
by: wombat53 | last post by:
Hi Group Are there any DB2 UDB ESE DPF V8.2 users exploiting "buffered inserts" (BIND parm INSERT BUF) *and* "multi-row INSERTS" (many rows associated with the VALUES clause of the INSERT to...
4
2893
by: Michel Esber | last post by:
Hello, Environment: db2 V8 FP 13 LUW Our application currently uses: insert into table values ('A'),('B'),...('Z') We have used CLI arrays inserts (1000 array and commit size) and...
20
188220
by: talktozee | last post by:
Hey, everyone! Basically, I need to insert *multiple rows* into table A from table B based upon some criteria, and I need to insert some static values along with each row from table A. For...
58
8013
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
0
6960
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7116
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5418
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4857
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4551
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1376
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
595
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
247
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.