Re: Creating an Auto-Number and Currency data type in SQL

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Al Reid (areidjr_at_reidDASHhome.com)
Date: 03/12/04


Date: Fri, 12 Mar 2004 07:18:44 -0500

MSSQL does, indeed have an auto-number type called and Identity field. It
is essentially the same as MSAccess AutoNumber.

CREATE Table TEST (
   ID int IDENTITY(1,1), .....)

will create an autonumber column starting at 1 and incrementing by 1.

For Currency, see money and smallmoney data types.

Also, the SQL Server Books Online is a great source of info.

--
Al Reid
"Ricardo Furtado" <anonymous@discussions.microsoft.com> wrote in message
news:32AFA53F-806F-401E-9093-CFEFA7682993@microsoft.com...
> i'm using SQL to create fields in a table.
> Microsoft Access has the "Auto-Number" type, and i think that SQL doesn't.
I think the only option i have is to use long varbinary.
> I'm also using the "currency" type and i also believe that SQL doesn't
have that type too
> Is there any way to create an "Auto-Number" field, and a "Currency" type?
>
> My special thanks in advanced
>


Relevant Pages

  • Non updatable query & duped IDs
    ... There is some VBA code (Access2k, Win2k, ODBC linked SQL ... Server tables) that has run perfectly for a weekly process ... The table had an identity field but no ... Why is a non-duplicated id field required to do lookups? ...
    (microsoft.public.access.modulesdaovba)
  • SQL Insert that return Identity, any samples
    ... I am looking for SQL Insert sample which returns the newly created id.I am ... using HTTP adapter to send an xml message that contains 1 Order and many ... the field Order.Id because it is an identity field.If i ...
    (microsoft.public.biztalk.general)
  • Re: IDENTITY Data Type Gaps
    ... > We recently upgraded an Access XP database to SQL Server, ... In the original Access database, ... to converting to SQL Server.) ... Identity field value. ...
    (microsoft.public.sqlserver.odbc)
  • Re: High Throughput Database
    ... the UserID and the Identity field? ... But whatever way you do it, should have a clustered index with UserID ... Links for SQL Server Books Online: ...
    (microsoft.public.sqlserver.programming)