Anyone out there knows how to drop the AutoInc of a field?
I need to remove this temporarily to udpate this field & set it back.
I just need to be able to drop the autoinc feature off for a while.

Re: how to remove the AutoInc of a field? by Eric

Eric
Wed Feb 09 00:36:20 CST 2005

Hello, Lianne!
You wrote on Wed, 9 Feb 2005 10:25:31 +1100:

L> Anyone out there knows how to drop the AutoInc of a field?
L> I need to remove this temporarily to udpate this field & set it back.
L> I just need to be able to drop the autoinc feature off for a while.

Take a look at the ALTER TABLE command:

* create demo cursor with autoinc field
CREATE CURSOR test (id I autoinc)
INSERT INTO test VALUES (10) && error
* remove autoinc feature
ALTER TABLE test alter COLUMN id I
INSERT INTO test VALUES (10) && no problem
* turn autoinc on and specify a new start value
ALTER TABLE test alter COLUMN id I AUTOINC NEXTVALUE 11

--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Re: how to remove the AutoInc of a field? by Paul

Paul
Wed Feb 09 09:26:25 CST 2005

Or use the Table Designer:

USE tablename
MODIFY STRUCTURE




"Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
news:%23VHIpGnDFHA.4072@TK2MSFTNGP10.phx.gbl...
> Hello, Lianne!
> You wrote on Wed, 9 Feb 2005 10:25:31 +1100:
>
> L> Anyone out there knows how to drop the AutoInc of a field?
> L> I need to remove this temporarily to udpate this field & set it back.
> L> I just need to be able to drop the autoinc feature off for a while.
>
> Take a look at the ALTER TABLE command:
>
> * create demo cursor with autoinc field
> CREATE CURSOR test (id I autoinc)
> INSERT INTO test VALUES (10) && error
> * remove autoinc feature
> ALTER TABLE test alter COLUMN id I
> INSERT INTO test VALUES (10) && no problem
> * turn autoinc on and specify a new start value
> ALTER TABLE test alter COLUMN id I AUTOINC NEXTVALUE 11
>
> --
> Eric den Doop
> www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8
>
>