Print Page | Close Window

Creating an Autonumber Field using SQL

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=11617
Printed Date: 30 March 2026 at 11:40pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Creating an Autonumber Field using SQL
Posted By: neotrix
Subject: Creating an Autonumber Field using SQL
Date 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 ?



-------------
http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..



Replies:
Posted By: Mart
Date 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)



Posted By: neotrix
Date 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 ?!?

-------------
http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..


Posted By: Mart
Date Posted: 24 August 2004 at 4:46pm
should do


Posted By: Semikolon
Date 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)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net