UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  UK Web Hosting | Dedicated Server Windows and Linux VPS Forum > Web Hosting and Domains > MySQL Hosting

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-02-2007, 02:39
Junior Member
 
Join Date: Feb 2007
Location: Reading
Posts: 3
Angry phpMyAdmin - SQL Server Insert Headache

Hi

I just can't get my head round this.

I am using phpMyAdmin to set up and manage a database, but I'm having real problems, trying to INSERT data into a table through the SQL Server windows.

Now here's the strange part - if I type the data directly into the SQL Server window it runs the query fine and adds the data to the table. However, if I paste the data from another file in exactly the same format it comes up with a syntax error???

#1064 - You have an error in your SQL Server syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Africa’, ‘20mm’, 258.5, 49.5),(NULL, ‘Nero Africa’, ‘30mm’, 291.5,' at line 1

If I use the MySQL prompt, it works fine too, but I can't copy and paste to this. I am 99.99999% certain there is nothing wrong with the syntax.

I could input all by hand but that would take forever. Please help before I am forced to get a paper round.

Thanks

Mark
Reply With Quote
  #2 (permalink)  
Old 13-02-2007, 19:40
Premium Member
 
Join Date: Jan 2007
Posts: 209
Default

Hi Mark,
Are those special characters legitimate? If not, Most likely your file format is different. DOS v/s Unix file system. A carriage return/Line feed (enter key) gets replaced by these characters. Also, Ensure that the file from which you are copying is uploaded as TEXT not BINARY.

Also ensure that the table exists and the name is correct in your file.

From what I can see, ' (single-quote) is getting converted to these characters - ('Africa', '20mm', 258.5, 49.5),(NULL, 'Nero Africa', '30mm', 291.5,...
^ Why is this comma here?


Regds
IJ

Last edited by swexpert; 13-02-2007 at 19:51.
Reply With Quote
  #3 (permalink)  
Old 14-02-2007, 00:38
Junior Member
 
Join Date: Feb 2007
Location: Reading
Posts: 3
Default

Aha - that makes sense.

What I have been doing is pating an excel spreadsheet of data into Word, converting that from a table to text and then using find and replace to put relevant commas/brackets in. Then copying that into the SQL Server query window and adding any relevant insert code to it.

Is there a specific way to copy and paste as .txt, or do I just need to save the word file as a .txt document and then it will work?

Thanks for your help.

Mark
Reply With Quote
  #4 (permalink)  
Old 14-02-2007, 12:55
Premium Member
 
Join Date: Jan 2007
Posts: 209
Default

Hello Mark,
In Excel, export ( File->Save As) the worksheet as Comma Separated Values (CSV) File (OR TEXT file as per your query). Then in phpmyadmin, use the import feature and select appropriate CSV option.

Note that some installations don't show all options, just SQL Server in import options. In that case, you'll first have to export the data from Excel to an SQL Server file using some other tool such as SQLYog

That should ease this cumbersome process for you.

Regds
IJ
Reply With Quote
  #5 (permalink)  
Old 04-03-2007, 11:22
Junior Member
 
Join Date: Feb 2007
Location: Reading
Posts: 3
Default

IJ

Thanks very much for this - I have downloaded SQLYog and have now managed to insert300 od rows of data in one fell swoop. My headache is gradually easing.

YOU ARE A STAR
Reply With Quote
  #6 (permalink)  
Old 04-03-2007, 18:46
Premium Member
 
Join Date: Jan 2007
Posts: 209
Default

hi marco
thanks a lot! There are even brighter stars...
Tutorial:Creating mySQL database, table using phpMyAdmin


regds
IJ
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:47.

 

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by Web Hosting 3.1.0
Copyright © 2001-2008, eUKhost.com. All rights reserved.

 
Site Map

VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

Business Web Hosting
100% uptime Hosting

Cpanel Hosting
cPanel Shared Hosting

Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

Customer Testimonials
eUK Customer Testimonials


knowledgebase articles

eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting


popular blog categories


Web Hosting
Website Hosting articles

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles

Linux Operating System
Linux Operating techniques

Windows Web Hosting
Windows plesk articles