Results 1 to 2 of 2

Thread: Create table statement syntax error in access 2000

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Arrow Create table statement syntax error in access 2000

    Hi guys i tried to run this create table statement and each time i get syntax error.
    I pasted the code in sql view windows of access 2000 and pressed the run code and i get
    this error massage saying there is syntax error. Could any one help me write correct
    create table statement that does not give me this error.I know u might tell me why u
    do not create table in design view or .. but i want to do this since i want learn this
    method as well.thanks


    Code:
    CREATE TABLE PLAYERS
    (PLAYERNO SMALLINT NOT NULL  CHECK (PLAYERNO >0),
    NAME CHAR(25) NOT NULL ,
    INITIALS CHAR(5) NOT NULL ,
    BIRTH_DATE DATETIME,
    SEX CHAR(1) NOT NULL ,
    JOINED SMALLINT CHECK (JOINED >=1980),
    STREET CHAR(15) NOT NULL ,
    HOUSENO CHAR(4),
    POSTCODE CHAR(6),
    TOWN CHAR(10) NOT NULL ,
    PHONENO CHAR(10),
    LEAGUENO CHAR(4),
    PRIMARY KEY (PLAYERNO)
    )

  2. #2
    Addicted Member
    Join Date
    Jul 2004
    Location
    Mumbai
    Posts
    236

    Re: Create table statement syntax error in access 2000

    The problem is with the CHECK Constriant. if you remove that then the statement works fine.

    but the statement executes fine in sql server. so i think ms-access does not support the CHECK Constraint(i tried for more than an hour searching in web and changing the code. no positive result). but access does support unique, pk fundas. anyhow i am not sure that ms-access supports this(check constraint) or not.

    (One more thing(a Suggesstion) . You must have posted this question in the database forum. if you had did that then you might have got clear explanation by this time. so try posting in the right forum in future).
    --Kishore...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width