Guest joy Posted August 25, 2006 Share Posted August 25, 2006 Hi..can some one help me how to add multiple rows at a time.I usually do this using insert into that many times..Ex: If I have to insert two rows I do it this wayINSERT INTO tablenameVALUES(a,b,c)INSERT INTO tablenameVALUES(f,s,d)I am using sql server.Thanks in advance.. Link to comment Share on other sites More sharing options...
murfitUK Posted August 25, 2006 Share Posted August 25, 2006 You only need to separate the new row values with a comma.INSERT INTO tablename VALUES (a, b, c), (f, s, d), (x, y, z);Don't forget to put single quotes round strings though. Link to comment Share on other sites More sharing options...
Jack McKalling Posted August 28, 2006 Share Posted August 28, 2006 The full syntax: INSERT INTO tablename (column1, column2, column3)VALUES ('a1','a2','a3'), ('b1','b2','b3'), ('c1','c2','c3') Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now