Generating values as part of a compound key
- From: "Mark" <news@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 30 Aug 2005 12:42:02 +0100
BEGINNER QUESTION
I have a table which has a compound primary key consisting of two columns.
One of these columns is a foreign key which is generated in another table by
an identity.
I want to be able to generate the other primary key column value
automatically when an insert occurs but assume that I cannot use an identity
because it would have to be unique for this table.
There will be potentially more than one user accessing this table so I want
to avoid generating the key on the client side.
How can I do this? Will it require some hardcore T-SQL?
I hope this is clear (I suspect it isn't) I'd be happy to supply more info.
I would be extremely grateful for any help!
Mark.
.
- Follow-Ups:
- Re: Generating values as part of a compound key
- From: Robert Klemme
- Re: Generating values as part of a compound key
- Prev by Date: Re: Rewrite a WHERE clause
- Next by Date: Re: Strange date/time anomaly, or am I just stoopid?
- Previous by thread: SQl server processors and threads
- Next by thread: Re: Generating values as part of a compound key
- Index(es):
Relevant Pages
|