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!

Add a unique key value to every row in a set that is not identity

Status
Not open for further replies.

tstocksql

Programmer
Sep 23, 2005
20
US
Hi,
I would like to step through every row in an existing record set, not using cursor preferably, and add a key value to one column. When I tried this with cursor it was slow. Is there a better method?

 
Your two options are a cursor or to add an identity column. Since you are looking to put a different value in each record you need to process each record one at a time.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
Donate to Katrina relief
 
WOW! That was fast! Thank you Denny.

Will DTS trigger an identity column on an import?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top