471,851 Members | 971 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,851 software developers and data experts.

primary key autoincrement question.

I have a table in my sqlserver 2000 that has a field IDNO. i want this
field to be my primary key. however i don't want this field to use the
autoincrement feature. when i access this table from vb.net and try to
add a record this field is autoincrementing. how can i disable the
autoincrement of this field yet serves this as my primary key?

thanks in advance
Jul 20 '05 #1
4 17365
go to design, select your id make shure that there is a key symbol next to
it (if not right click and set primary key)
this makes it the primary key the identity is something else -->
autoincrementing set it to false and there you go :)

hope it helps

eric

"jaYPee" <hi******@yahoo.com> wrote in message
news:8v********************************@4ax.com...
I have a table in my sqlserver 2000 that has a field IDNO. i want this
field to be my primary key. however i don't want this field to use the
autoincrement feature. when i access this table from vb.net and try to
add a record this field is autoincrementing. how can i disable the
autoincrement of this field yet serves this as my primary key?

thanks in advance

Jul 20 '05 #2
Thank you for the reply. however i can't find an autoincrementing
properties under column properties in order to set it to false.

under column properties of IDNO field i have i only see this
properties:

Description
Default Value
Precision
Scale
Identity
Identity Seed
Identity Increment
Is RowGuid
Formula
Collation

i presume before and until now that i have to set the identity to "no"
but still in my vb.net app when i add record the IDNO field still
increment to the last value + 1.

don't know where can i set the autoincrement to "false"

thanks again

On Tue, 6 Apr 2004 09:41:21 +0200, "EricJ"
<er********@ThiSbitconsult.be.RE> wrote:
go to design, select your id make shure that there is a key symbol next to
it (if not right click and set primary key)
this makes it the primary key the identity is something else -->
autoincrementing set it to false and there you go :)

hope it helps

eric

"jaYPee" <hi******@yahoo.com> wrote in message
news:8v********************************@4ax.com.. .
I have a table in my sqlserver 2000 that has a field IDNO. i want this
field to be my primary key. however i don't want this field to use the
autoincrement feature. when i access this table from vb.net and try to
add a record this field is autoincrementing. how can i disable the
autoincrement of this field yet serves this as my primary key?

thanks in advance


Jul 20 '05 #3
these are the ones you are after
Identity
Identity Seed
Identity Increment
yust set the identity to false the rest will follow :)

eric

"jaYPee" <hi******@yahoo.com> wrote in message
news:ao********************************@4ax.com... Thank you for the reply. however i can't find an autoincrementing
properties under column properties in order to set it to false.

under column properties of IDNO field i have i only see this
properties:

Description
Default Value
Precision
Scale
Identity
Identity Seed
Identity Increment
Is RowGuid
Formula
Collation

i presume before and until now that i have to set the identity to "no"
but still in my vb.net app when i add record the IDNO field still
increment to the last value + 1.

don't know where can i set the autoincrement to "false"

thanks again

On Tue, 6 Apr 2004 09:41:21 +0200, "EricJ"
<er********@ThiSbitconsult.be.RE> wrote:
go to design, select your id make shure that there is a key symbol next toit (if not right click and set primary key)
this makes it the primary key the identity is something else -->
autoincrementing set it to false and there you go :)

hope it helps

eric

"jaYPee" <hi******@yahoo.com> wrote in message
news:8v********************************@4ax.com.. .
I have a table in my sqlserver 2000 that has a field IDNO. i want this
field to be my primary key. however i don't want this field to use the
autoincrement feature. when i access this table from vb.net and try to
add a record this field is autoincrementing. how can i disable the
autoincrement of this field yet serves this as my primary key?

thanks in advance

Jul 20 '05 #4
>> I have a table in my SQL Server 2000 that has a field [sic] IDNO. I
want this field [sic] to be my primary key. <<

You need to read a book on SQL and RDBMS. Rows are not records; fields
are not columns; tables are not files; there is no sequential access
or ordering in an RDBMS, so "first", "next" and "last" are totally
meaningless.

What does this table model in the real world? Look at the real world
and ask what the key is. It cannot ever be the internal state of the
hardware in which your model resides. You are still thinking that
there are rcord numbers, like a sequential file system in an RDBMS --
you even use the terminology of a sequential file system.

This is totally wrong. There is no "Magic, Universal
one-size-fits-all" way to get a key. Building a data model is work.
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by ken | last post: by
8 posts views Thread by jaYPee | last post: by
9 posts views Thread by Steven C. | last post: by
1 post views Thread by nofear | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.