Inserting a record to only create the identity field

Inserting a record to only create the identity field

Post by STom » Sun, 09 Dec 2001 04:47:29



I need to insert a record into a table but really all I want to do is create
a record that only has the identity field created. What is the syntax for
doing this from an insert statement?

INSERT INTO myTable (do I need something here) VALUES (or here?)

Thanks.

STom

 
 
 

Inserting a record to only create the identity field

Post by Dinesh T » Sun, 09 Dec 2001 05:03:00


STom,

INSERT MyTable DEFAULT VALUES

Dinesh.


Quote:> I need to insert a record into a table but really all I want to do is
create
> a record that only has the identity field created. What is the syntax for
> doing this from an insert statement?

> INSERT INTO myTable (do I need something here) VALUES (or here?)

> Thanks.

> STom


 
 
 

1. Capture the identity field assigned to the new inserted record

Hi,

How do I select the value of a identify field right after an insert
statement is executed ?

In my data_parent table, the rec_id is an identify field (auto number),
there is a data_child table which should contain the data_parent key
(rec_id), I need to capture the data_parent.rec_id right after I call the
insert in parent in order to setup the data_child with correct relationship.

Any suggestion is welcome.

Thanks.

Jean

2. SUSER_SNAME()

3. Insert record w/SQL Server identity field

4. Problems with ReportSmith !

5. Insert record to a table with identity field?

6. Access Datasheets in VB forms

7. Identity field available when you create a new record

8. Beginner help needed

9. Attempt to insert duplicate identity values in table (has identity and key fields)

10. Creating identity field that restarts when other field changes

11. Create a trigger that populates a field with a unique number (like an Identity Field)

12. Create Trigger - Insert, Update - not updating record on Insert

13. Get record ID of a new record created with INSERT