Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to install multiple records on the remote server using this statement

SQL
Insert into XYZ
(
a,
b
)
Values
('x','y'),
('x','y'),
('x','y'),
('x','y')


but its not inserting however if i insert single value then its working, where i am wrong? please help.
Posted
Updated 3-Dec-11 3:54am
v5

You should write them in separate insert commands.
SQL
Insert into XYZ(a,b) Values ('x','y')
Insert into XYZ(a,b) Values ('x','y')
Insert into XYZ(a,b) Values ('x','y')
Insert into XYZ(a,b) Values ('x','y')



And if source data is located in a table use insert into TARGETTABLE(FIELD1, FIELD2, ... ) select FIELD1, FIELD2, ... from SOURCETABLE command .


Hope it helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900