Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Create a table with an autonumber field with SQL (2003)

    I am used to using DAO for this sort of thing but in this project I need to use Jet SQL.
    I am trying to make a table with an autonumber field and then set its validation rule to =1 ( so it can only ever hold one row)
    Do I start with -
    Create Table T0023([Pretender_ID] Long);

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Create a table with an autonumber field with SQL (2003)

    To create an AutoNumber field, use COUNTER or AUTOINCREMENT as field type:

    CREATE TABLE T0023 (Pretender_ID COUNTER)

    You cannot create a validation rule in SQL. You need DAO for that.

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Create a table with an autonumber field with S

    I'm trying to convince them to move to the DAO procedures I have written with your help.
    thanks again

Posting Permissions

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