Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inserting multiple rows in mysql

Status
Not open for further replies.

rninja

Technical User
Apr 11, 2001
381
US
I need to add multiple rows into multiple tables into a mysql database. Is there any way to do this without doing it by hand or writing my own script?
I have the database info converted from mssql, and now the arduous task of entering the data is upon me.

Thanks in advance for any help in this matter!
Rninja

smlogo.gif

 
hi,

multiple rows:
you manage this by the following query:

table: tablename
columns: name, age, ...

INSERT INTO tablename (name, age) VALUES ("tom","33"),
("jack","22"),("linda","24"),...



greetings markus
 
if you have used the function in mssql server that creates scripts from your database, you'll need to edit them - they are not fully compatible with mysql (tried that long ago so maybe it's fixed now ;-) )
i was using the export feature - put the data in a comma separated file and import it using the mysqlimport command or via phpmyadmin interface

or if the database info file is in format that mysql undestands:
mysql -u username -ppasswd < dbinfo.sql

hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top