Groups
Groups
Sign in
Groups
Groups
H2 Database
Conversations
About
Send feedback
Help
identity column
65 views
Skip to first unread message
Igal
unread,
Jun 18, 2012, 4:34:29 PM
6/18/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to h2-da...@googlegroups.com
hi,
I migrated a database from MSSQL to H2.
when I insert a record to a table with an identity column that already has records, I expect the new record to have the highest id, but it does not.
any ideas?
thanks
Igal
unread,
Jun 18, 2012, 4:49:22 PM
6/18/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to h2-da...@googlegroups.com
please ignore this thread.
I copied the table from schema to public and the identity constraint was lost in the process. I fixed it by executing
ALTER TABLE table_name
ALTER COLUMN column_name
INT NOT NULL IDENTITY;
ALTER TABLE table_name
ALTER COLUMN column_name
RESTART WITH 100000;
thank you.
Reply all
Reply to author
Forward
0 new messages