Solved

Autoincrement field for SQL Server?

Posted on 2000-04-19
4
345 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 100 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

776 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