Solved

Autoincrement field for SQL Server?

Posted on 2000-04-19
4
347 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

691 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