#1
  1. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    749
    Rep Power
    98

    Cannot Create Table


    I am trying to create a table and I just cannot figure out the reason the creation fails.
    PHP Code:
    CREATE TABLE dbo.categories 
    (my_index int,
    school char(3),
    grade_level tinyint
    PRIMARY KEY 
    (my_index)); 
    I am doing this remotely via a script and I don't have a GUI interface.
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,656
    Rep Power
    4288
    you're missing a comma in front of PRIMARY KEY
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    5
    Rep Power
    0
    Hi Rudy,

    I could create the table on a SQL Server 2014 database without an error
  6. #4
  7. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,656
    Rep Power
    4288
    Originally Posted by eralper
    I could create the table on a SQL Server 2014 database without an error
    probably because you fixed the missing comma problem

    and why are you digging up a 9-month-old thread?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo