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
Solved

Set an auto-generated unique identifier column in SQL server table.

Posted on 2013-12-28
1
1,463 Views
Last Modified: 2013-12-28
Having spent years with MS Access I'm now adjusting to SQL Server.

In table design view, how do I create the equivalent of Access's autonumber field?
0
Comment
Question by:TimHudspith
1 Comment
 
LVL 25

Accepted Solution

by:
jogos earned 500 total points
ID: 39743343
You set the identity-property to a int-column, more details
http://msdn.microsoft.com/en-us/library/ms186775(v=sql.105).aspx

In design view that is in the column properties. Look for identity, say it is an identity-column  set startingpoint (seed) of your numbering and the increment
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
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.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

829 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