Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Creating an Autonumber Field using SQL
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Creating an Autonumber Field using SQL

 Post Reply Post Reply
Author
neotrix View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 09 November 2003
Location: Pakistan
Status: Offline
Points: 433
Post Options Post Options   Thanks (0) Thanks(0)   Quote neotrix Quote  Post ReplyReply Direct Link To This Post Topic: Creating an Autonumber Field using SQL
    Posted: 24 August 2004 at 4:17am

HyloOoo

i would like to know that how can i create a talbe with an autonumber field using SQL ?

i tried this

CREATE TABLE tblNewTable(
Username text,
password text,
)

both of them work fine, but when i try writing

CREATE TABLE tblNewTaable(

userID autonumber,

)

dosent work ?

Can you please help me with this ?

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 24 August 2004 at 5:31am

If this is SQL Server

CREATE TABLE test
(
Id int identity(1, 1) NOT NULL
)

... You just used Indentity(increment, seed)

Back to Top
neotrix View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 09 November 2003
Location: Pakistan
Status: Offline
Points: 433
Post Options Post Options   Thanks (0) Thanks(0)   Quote neotrix Quote  Post ReplyReply Direct Link To This Post Posted: 24 August 2004 at 4:30pm
Actually, it is MS Accesss Database i'm trying to work on, will this work with Access as well ?!?
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 24 August 2004 at 4:46pm
should do
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2004 at 11:14am
I hope you are aware of that you can't do some things with SQL on an access database, for example boolean fields. (you can use "bit" like you do on SQL Server, but the field wont work)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.