autonumber while working with SQL

J

Jim

Ran
In SQL Server, the following script will create an auto
numbered field called 'TestAutoNo', starting at 1 and
incrementing by 1.

CREATE TABLE [dbo].[Table1] (
[TestAutoNo] [numeric](18, 0) IDENTITY (1, 1) NOT
NULL
) ON [PRIMARY]
GO

If you are using an Access ADP, just set 'identity' to
yes, identity seed to 1 and identity increment to 1, while
maintaining the table to acheive the same thing.

Jim
 
R

Ran BD

and how do i display the number ?

Jim said:
Ran
In SQL Server, the following script will create an auto
numbered field called 'TestAutoNo', starting at 1 and
incrementing by 1.

CREATE TABLE [dbo].[Table1] (
[TestAutoNo] [numeric](18, 0) IDENTITY (1, 1) NOT
NULL
) ON [PRIMARY]
GO

If you are using an Access ADP, just set 'identity' to
yes, identity seed to 1 and identity increment to 1, while
maintaining the table to acheive the same thing.

Jim
-----Original Message-----
how can I define auto number datatype ?

thanks

Ran



.
 
J

Jim

Not sure what you are asking here. Are you trying to use
a form?; a report?... The identity number is just another
field in the table so is always available for display.

From a database design perpective though, auto number
fields are pretty meaningless to a user. If a number
needs displaying to a user then an auto number is probably
not the right thing to be using.

Jim
-----Original Message-----
and how do i display the number ?

Jim said:
Ran
In SQL Server, the following script will create an auto
numbered field called 'TestAutoNo', starting at 1 and
incrementing by 1.

CREATE TABLE [dbo].[Table1] (
[TestAutoNo] [numeric](18, 0) IDENTITY (1, 1) NOT
NULL
) ON [PRIMARY]
GO

If you are using an Access ADP, just set 'identity' to
yes, identity seed to 1 and identity increment to 1, while
maintaining the table to acheive the same thing.

Jim
-----Original Message-----
how can I define auto number datatype ?

thanks

Ran



.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top