I have an auto-increment table that I'm thinking of added a "well known"
member to, "(multiple accounts)". The easiest way to do this would be to add
it with a pkey of -1. I could do this by temporarily turning off identity,
adding it manually, and then turning the identity back on.
Any reason I should not do this?
Maury>>Any reason I should not do this?
None at all. It's application driven - and it's not limited to identities,
either.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Maury Markowitz" <MauryMarkowitz@.discussions.microsoft.com> wrote in
message news:C8766965-D775-4B73-9D21-6C89E025F994@.microsoft.com...
I have an auto-increment table that I'm thinking of added a "well known"
member to, "(multiple accounts)". The easiest way to do this would be to add
it with a pkey of -1. I could do this by temporarily turning off identity,
adding it manually, and then turning the identity back on.
Any reason I should not do this?
Maury|||"Tom Moreau" wrote:
> None at all. It's application driven - and it's not limited to identities,
> either.
So I guessed, but I wanted to be sure. Thanks!
Maury|||On 4 Jun, 20:19, Maury Markowitz
<MauryMarkow...@.discussions.microsoft.com> wrote:
> "Tom Moreau" wrote:
> > None at all. It's application driven - and it's not limited to identities,
> > either.
> So I guessed, but I wanted to be sure. Thanks!
> Maury
Tom is right. My only doubt is just why you would want to do this? A
surrogate key should be just that. You shouldn't care what its value
is because the value itself should not be relevant outside the
database. If you ascribe a some significance to values in an IDENTITY
column then you will probably have problems later on.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
没有评论:
发表评论