Is it possible to write an INSERT statement to add a row to a table with
just a single column which is an identity column ?
Thanks,
Donna.
Thanks,
Donna.
create table i (c1 int identity)
insert i default values
insert i default values
insert i default values
select * from i
drop table i
c1
-----------
1
2
3
Linda
Quote:> Is it possible to write an INSERT statement to add a row to a
table with
> just a single column which is an identity column ?
> Thanks,
> Donna.
You could use "set identity_insert ... on" to allow explicit values to be
inserted into the identity column of a table. For example:
SET IDENTITY_INSERT tablename ON
GO
INSERT INTO tablename(id) values(1)
This posting is provided 'AS IS' with no warranties, and confers no rights.
Regards,
Haiwei Xu
1. Inserting into a one-column table with identity set
Hi,
How can I insert (SQL) a row into a table with one column. The column is an
identity column.
We do not want to add a dummy column.
This does not work:
INSERT INTO table_1
Erik
3. Inserting an entry into a table that has one attribute that's an identity column
4. Batch retrieval of recordset
5. Really simple question: How to insert a table with only one column (also identity)
7. inserting multible columns from one table into a single column in another table
9. Insert into same table pulling one column from another table
10. SELECT...INSERT into a TABLE with IDENTITY column
11. Cannot insert explicit value for identity column in table
12. Error inserting into table with Identity column
13. INSERT INTO TABLE KEYED ONLY ON IDENTITY COLUMN RESULTS IN KEY VIOLATION (6.5)