SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 create table problem
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

columbo1977a
Starting Member

2 Posts

Posted - 06/08/2006 :  10:53:20  Show Profile  Click to see columbo1977a's MSN Messenger address
Hi

I am transfering the table from my computer to my control panel on the website but when i try to create it it comes up with the following error

You have an error in your SQL syntax near '-Enter Password varchar(20) NOT NULL default '', House No_Name varchar(20) defa' at line 1.

Query: CREATE TABLE users ( MemberId int(8) NOT NULL auto_increment, Forname varchar(20) NOT NULL default '', Surname varchar(20) NOT NULL default '', Username varchar(20) NOT NULL default '', password varchar(20) NOT NULL default '', Re-Enter Password varchar(20) NOT NULL default '', House No_Name varchar(20) default NULL, Street varchar(20) default NULL, Village varchar(20) default NULL, Town varchar(20) default NULL, County varchar(20) default NULL, Postcode varchar(10) default NULL, Telephone varchar(13) default NULL, Mobile varchar(15) default NULL, Fax varchar(15) default NULL, Email varchar(25) NOT NULL default '', Web Address varchar(50) default NULL, Date Joined date NOT NULL default '0000-00-00', Level Of Knowledge varchar(15) default NULL, Interests varchar(30) default NULL, Comments text, PRIMARY KEY (MemberId) ) TYPE=MyISAM

the code that i pasted into the sql window is below :

You have an error in your SQL syntax near '-Enter Password varchar(20) NOT NULL default '', House No_Name varchar(20) defa' at line 1.

Query: CREATE TABLE users ( MemberId int(8) NOT NULL auto_increment, Forname varchar(20) NOT NULL default '', Surname varchar(20) NOT NULL default '', Username varchar(20) NOT NULL default '', password varchar(20) NOT NULL default '', Re-Enter Password varchar(20) NOT NULL default '', House No_Name varchar(20) default NULL, Street varchar(20) default NULL, Village varchar(20) default NULL, Town varchar(20) default NULL, County varchar(20) default NULL, Postcode varchar(10) default NULL, Telephone varchar(13) default NULL, Mobile varchar(15) default NULL, Fax varchar(15) default NULL, Email varchar(25) NOT NULL default '', Web Address varchar(50) default NULL, Date Joined date NOT NULL default '0000-00-00', Level Of Knowledge varchar(15) default NULL, Interests varchar(30) default NULL, Comments text, PRIMARY KEY (MemberId) ) TYPE=MyISAM

Can someone please tell me why i cant get this working?

Columbo1977

khtan
In (Som, Ni, Yak)

Singapore
17681 Posts

Posted - 06/08/2006 :  10:57:43  Show Profile
don't use '-' and space in the column name. If you want to you have to enclose in []
[Re-Enter Password] varchar(20) NOT NULL default


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22772 Posts

Posted - 06/08/2006 :  10:58:50  Show Profile  Send madhivanan a Yahoo! Message
>>MemberId int(8) NOT NULL auto_increment,

Are you using MS SQL Server?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17681 Posts

Posted - 06/08/2006 :  11:13:15  Show Profile

Oh.. did not see that and this "TYPE=MyISAM". Looks like MySQL.
Please post your question over at MySQL in dbforums.com


KH

Go to Top of Page

columbo1977a
Starting Member

2 Posts

Posted - 06/08/2006 :  11:34:47  Show Profile  Click to see columbo1977a's MSN Messenger address
quote:
Originally posted by khtan


Oh.. did not see that and this "TYPE=MyISAM". Looks like MySQL.
Please post your question over at MySQL in dbforums.com


KH





It was the spaces i replaced them with underscores.


thanks anyway

columbo1977
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000