Really simple question: How to insert a table with only one column (also identity)

Really simple question: How to insert a table with only one column (also identity)

Post by Changsong B » Tue, 17 Jul 2001 23:56:43



My question is what is the syntax to insert a table with only one column
which is the primary key of the table. It is also the type of identity. I
tried

Insert into table1 values ();
Insert into table values (NULL);

both failed. Any suggestion? Thanks a lot.

Changsong

 
 
 

Really simple question: How to insert a table with only one column (also identity)

Post by Darren Brinksneade » Wed, 18 Jul 2001 00:08:10


INSERT INTO table1 DEFAULT VALUES

--
Darren Brinksneader MCDBA, MCSE+I, CNE, CCA, MCT, CTT


Quote:> My question is what is the syntax to insert a table with only one column
> which is the primary key of the table. It is also the type of identity. I
> tried

> Insert into table1 values ();
> Insert into table values (NULL);

> both failed. Any suggestion? Thanks a lot.

> Changsong


 
 
 

Really simple question: How to insert a table with only one column (also identity)

Post by Changsong B » Wed, 18 Jul 2001 00:15:32


Thank you very much!

> INSERT INTO table1 DEFAULT VALUES

> --
> Darren Brinksneader MCDBA, MCSE+I, CNE, CCA, MCT, CTT



> > My question is what is the syntax to insert a table with only one column
> > which is the primary key of the table. It is also the type of identity.
I
> > tried

> > Insert into table1 values ();
> > Insert into table values (NULL);

> > both failed. Any suggestion? Thanks a lot.

> > Changsong

 
 
 

1. inserting multible columns from one table into a single column in another table

example:  in gupta I could write the following sql statement to insert
multible columns from one table into a singe column in another table.

insert into receipttable (id,name) select id,firstname|| ' ' lastname
from mastertbl where id=1

results:

1,Angelique Worrell

sql server 7.0  -- i get the following error:

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '|'.

How is this done?

Angel

2. esql questions

3. A simple question, really simple

4. OWS, Java, JDBC/ODBC

5. Insert into same table pulling one column from another table

6. Apache segmentation faults

7. insert data from one field in one table to another field in another table

8. 14707-NY-NEW YORK-SQL *Loader-SQL*Plus-ORACLE-Database Administrator

9. Insert a new record in a table with just one column

10. Inserting into a one-column table with identity set

11. Insert into a table with only one identity column

12. Inserting an entry into a table that has one attribute that's an identity column

13. Insert columns from one table to another