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

auto ID field 1

Status
Not open for further replies.

DougP

MIS
Joined
Dec 13, 1999
Messages
5,985
Location
US
I have used Access autoNumber to create a unique Id of each record.
I would like to do th esame in SQL server 7
I know the is a time Stamp
but I would like to use regular numbers like
1
2
3
4
5

which field type is this

TIA DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Create in a VBA module such code:

global IncrementVariable as integer
function IncrementValues() as integer
IncrementValues = IncrementVariable + 1
end function

in the query you will do

select IncrementValues(), xxx, yyy, zzz from yourTable
John Fill
1c.bmp


ivfmd@mail.md
 

The SQL Server equivalent of Access Autonumber is Identity.

Create Table (RecId int identity (1,1), col1 <data type>, col2 <data type>, ...)

In Enterprise manager you would create the column name, select datatype INT and set Idenity = Yes. Terry Broadbent
Please review faq183-874.

&quot;The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge.&quot; - Daniel J Boorstin
 
thanks tlbroadbent
how 'bout a star
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top