Not sure which rdbms you are using, but on the SQL server you can allow insertions into the identifier column:
SET IDENTITY_INSERT dbo.MyTable ON
But I'm not sure why you would like to do this ...
Instead, when you do: object.table ('table_name'), collect more than just column names, for example. ColumnName, DataType, IsIdentity, etc. It can be a multidimensional array or class.
Then insert / select, you can filter the IsIdentity column. Knowing data types can also be useful when building inlays.
source share