autoincrement field 
Author Message
 autoincrement field

When doing bulk insertion, is it possible to have key field autoincremented?

Thanks



Fri, 18 Jun 2004 10:38:35 GMT  
 autoincrement field
In version 8 it is supposed to be there, but until then you can use a
trigger on the insert  to do the same thing.

Tim Shelton

Quote:

> When doing bulk insertion, is it possible to have key field
autoincremented?

> Thanks



Sat, 19 Jun 2004 01:18:12 GMT  
 autoincrement field
There's an example in TasTrade of a call to the NextID() function as the
default value of the PK field.

--

Cindy Winegarden  MCSD, Microsoft MVP

http://msdn.microsoft.com/vfoxpro  http://foxcentral.net


Quote:
> In version 8 it is supposed to be there, but until then you can use a
> trigger on the insert  to do the same thing.

> Tim Shelton




Quote:
> > When doing bulk insertion, is it possible to have key field
> autoincremented?

> > Thanks



Sat, 19 Jun 2004 03:02:25 GMT  
 autoincrement field
See the sample Newid.dbc for the stored procedure code and and pk default
procedure call that will do this.
-Anders

Quote:

> When doing bulk insertion, is it possible to have key field
autoincremented?

> Thanks



Sat, 19 Jun 2004 03:17:46 GMT  
 autoincrement field


Quote:
> There's an example in TasTrade of a call to the NextID() function as the
> default value of the PK field.

Insert into or append from do not appear to respect those default values ???

Thanks



Sat, 19 Jun 2004 14:14:36 GMT  
 autoincrement field
ILiya,

Yes they do if there is no value available. Example:

CREATE TABLE Test (Field1 I, Field2 I)
*!* Put the NextID function on Field1
m.Field2 = 1
*!* Note that no value is available for Field1.
INSERT INTO Test FROM MEMVAR
*!* The NextID() will fire to give a value for Field1

--

Cindy Winegarden  MCSD, Microsoft MVP

http://msdn.microsoft.com/vfoxpro  http://foxcentral.net

Quote:



> > There's an example in TasTrade of a call to the NextID() function as the
> > default value of the PK field.

> Insert into or append from do not appear to respect those default values
???

> Thanks



Sun, 20 Jun 2004 04:08:21 GMT  
 autoincrement field
They most certainly do, but it onlly applies to VFP tables of course. Not
all the tables in Tastrade use an autoincrement default primary key. In my
Tastrade database There are seven tables in Setup.dbf.
-Anders

Quote:



> > There's an example in TasTrade of a call to the NextID() function as the
> > default value of the PK field.

> Insert into or append from do not appear to respect those default values
???

> Thanks



Sun, 20 Jun 2004 04:01:31 GMT  
 autoincrement field
See the Primary Key article on my website.

--
Craig Berntson
MCSD, Visual FoxPro MVP
www.craigberntson.com
Salt Lake City Fox User Group
www.slcfox.org
Visit FoxCentral www.foxcentral.net
---

Quote:

> When doing bulk insertion, is it possible to have key field
autoincremented?

> Thanks



Sun, 20 Jun 2004 11:23:49 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. How to retrieving the autoincrement fields value from SQL server

2. VFP Autoincrement Field

3. autoincrement field through remote views doesn't seem to work

4. Need help with autoincrement fields

5. autoincrement field - Visual Foxpro database and ADO connection

6. Autoincrement a field in a Trigger?

7. Autoincrement?

8. AutoIncrement

9. AutoIncrement

10. How to convert Currency Field to Numberic Field?

11. Problem for converting DateTime field to Date Field

12. How do you keep a user from typing past the field length into the next field

 

 
Powered by phpBB® Forum Software