Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoNumber Translation from Access 1

Status
Not open for further replies.

bradleyhorn

Technical User
Sep 15, 2004
35
0
0
US
Hello All,

I have some tables that I have brought over from Access into my SQL Server Database. The Autonumber feature doesn't seem to have translated over to the SQL database for some fields. How can I take the existing SQL Server tables and add an automatically supplied number to individual (ID) fields? Can I do it right in enterprise manager or do I have to do it at the command line?

Bradley
 
You can do this either way. You want to make the field in question called an identity field. Edit the table design. Select the field in question. At the bottom, where it says itentity change it to yes. Set your seed and interval as needed. Save the table. As new records are inserted the field will be filled out automatically.

If there is already data in the field, be sure to set the seed above the highest number already in the field, or you will get duplicate numbers.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top