|
-
Mar 29th, 2000, 11:57 AM
#1
Thread Starter
New Member
Hi There!
When I save a new record in the database, I used before 'Select @@Identity' to retrieve the primary (or do I better call it unique index) of that freshly inserted record.
I then save some other record in a second table and save this unique index to create a one to many relationship.
Now I heart, its bad to rely on the value returned for @@Identity, because for an multiuser application. I can understand this perfectly.
But why should I not rely on this unique index to create my one to many relationship and what would be a better method?
Cheers,
Peter
-
Mar 29th, 2000, 06:54 PM
#2
Fanatic Member
Set a variable to @@IDENTITY straight after the insert and use that.
You must declare it first!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|