September 24, 2010 at 8:53 am
Please can someone take aquick glance at this code and let me know what is wrong.
I am a coplete newbie who has just started learning SQL so this is probably the easiest answer ever!
CREATE TABLE CUSTOMER_DATA
( MPAN INT,
EAC INT,
GSP INT,
CUSTOMER_NAME VARCHAR(60) ) ;
INSERT INTO CUSTOMER_DATA ( MPAN, EAC, GSP, CUSTOMER_NAME )
VALUES ( 1234, 1000, 10, 'Company1' ) ;
Thanks in advance
September 24, 2010 at 8:59 am
Can't see anything wrong with that code, what is the problem you are having?
September 24, 2010 at 8:59 am
September 24, 2010 at 9:14 am
Thanks for the quick reply guys.
The error I am getting is as follows:
"Syntax error in Create Table statement"
Any ideas?
September 24, 2010 at 9:42 am
That doesn't even sound like a SQL Server error. SQL's would be something like
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'CREATE'.
Are you using Microsoft SQL Server here? Or is it maybe something else (MySQL, Oracle, MS Access)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 24, 2010 at 9:47 am
To my shame I am indeed using Access to learn the basics as I am waiting for SAS to be installed onto my laptop.
I have just asked one of the IS guys at the office and he has pointed out that you can only run SQL querries one at a time in Access. As I was trying to do more than one querry at a time, this is where the problem lies.
Thanks for your time guys. I have no doubt that I will be on this forum again come Monday!
Ross
September 24, 2010 at 9:55 am
The SQL language used by MS Access and MS SQL Server is similar, but not the same. Hence, if you're not using SQL Server itself, please tell us what you are using, otherwise the advice you get will be fairly worthless
If you're using MS Access and querying against MS Access tables, I suspect your CREATE TABLE will still fail. Varchar is a SQL Server data type, not one that MS Access has (there it'll be text(50) I believe)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply