Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Getting bad syntax adding a column

Author  Topic 

DeepGround
Yak Posting Veteran

73 Posts

Posted - 2011-07-28 : 16:48:22
Any ideas?

mysql> ALTER TABLE 'clients' ADD 'COM' INT AFTER 'hosted';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
ne 1
mysql> ALTER TABLE 'clients' ADD 'COM' INT;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
mysql> ALTER TABLE 'clients' ADD 'comp' INT;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
mysql> ALTER TABLE 'clients' ADD comp INT;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
mysql> ALTER TABLE 'clients' ADD comp INT;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
mysql> ALTER TABLE 'clients' ADD 'comp' INT;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
mysql> ALTER TABLE 'clients' ADD 'COM' INT;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
mysql> ALTER TABLE 'clients' ADD 'COM' VARCHAR(50);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-07-28 : 16:57:50
I don't know about MySql syntax, but in SQL Server you'd have to remove the single quotes, all of them. I don't know anything about "AFTER", that appears to be MySql specific.

You've posted your question on a site that specializes in Microsoft SQL Server. You will get better help if you posted your question on a site that deals with your technology. Try dbforums.com or mysql.com for starters.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

DeepGround
Yak Posting Veteran

73 Posts

Posted - 2011-07-28 : 19:25:29
Ok, it was my syntax, the syntax I was using was from an article on mysql. O well. Thanks! tkizer to the rescue every time.
Go to Top of Page
   

- Advertisement -