Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Autoincrement field for SQL Server?

Posted on 2000-04-19
4
Medium Priority
?
350 Views
Last Modified: 2012-06-27
I have been working in Paradox for a long time.  There is an autoincrement field type there that will create a unique number for its field automatically.  Numbers are not re-used even if a record is deleted.  

I use those fields as key fields.  Is there a way to automatically generate a unique identifier field in SQL server?
0
Comment
Question by:phillip1
  • 3
4 Comments
 
LVL 2

Expert Comment

by:ginde
ID: 2730851
use Identity fields.

create table xxx(
id integer NOT NULL IDENTITY,
fld1 varchar(30) )
0
 
LVL 2

Accepted Solution

by:
ginde earned 400 total points
ID: 2730859
I think that is the answer.
0
 

Author Comment

by:phillip1
ID: 2731022
I am a Delphi programmer. How would you create that from the SQL Enterprise Mgr?
0
 
LVL 2

Expert Comment

by:ginde
ID: 2731045
In the SQL Enterprise Mgr Double click on tables, it will take you to new table. Fill in "id" field name, integer as data type and then press on "+" sign on menubar. You will see a place where you can select identity field. Make sure that id field is integer and does not allow nulls...

-Ginde
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question