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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Number Index

Status
Not open for further replies.

gkrenton

MIS
Jul 2, 2003
151
0
0
US
My sql skills are just above a beginner level & this one has me stumped but I'm sure their is a command or way to do this:
I am needing to create a new table with data from an existing table while adding a 'unique' number identifier to the data that I'm adding to the table.
Access has 'autonumber' what would be the equivelent statement in sql that I could use when bringing in this data & associating a unique/primary field to it.

Thanks in advance.

Gina
 
Take a look at the SERIAL column type.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks I'll look it up & see if makes sense. Guess the other question that I didn't ask is there anyway to do the same in a 'view' vs making an new table & adding the auto index number?

- Gina
 
You can't associate a new primary key to a view.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hmm - how about a non-primary autonumber field to a view? Guess it doesn't make much difference just wanted to ask.

thanks

-Gina
 
You may consider ROWID but don't rely on its value.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top