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

Add Unique Key to Select..Into statement? 1

Status
Not open for further replies.

MDA

Technical User
Joined
Jan 16, 2001
Messages
243
Location
US
Hi all,

Is there any way to add a unique key field to a Select...Into statement? I know I can use the newId() syntax but this creates a huge string.

Select newId() IdKey , * INTO ixvJCSOURCE from ixvJCTrans

I just want an incrementing unique number. I am trying to avoid a Stored procedure or using the Insert Into command.

Any ideas?
Thanks,
MDA
 
Select IDENTITY(int,1,1) IdKey , *
INTO ixvJCSOURCE
from ixvJCTrans



--Angel [rainbow]
-----------------------------------
Every time I lose my mind, I wonder
if it's really worth finding.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top