How to disable auto audentity of a DB2/400 table

Tags:
AS 400
DB2/400
SQL Server
Hello,
For a migration data project (from SQL/Server to DB2/400), we need to disable the auto identifiers of a DB2/400 table.
On SQL Server, the equivalent command is "set identity_insert MyTable off".
Thank you in advance
JC Cherid
   


Software/Hardware used:
DB2/400
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

How are you trying to convert these over to DB2?  As far as I know there is no easy way. You might try and send the files over and then edit the file on the DB2 side and drop the column. CHGPF or better yet, use STRSQL on the DB2 side

Then something like this
ALTER TABLE <old_name> RENAME TO <another_name>

Then recreate the old table without the deleted column(s):

SELECT col1, col2, col4 INTO TABLE <old_name> FROM <another_name>

Then delete the old table:

DROP TABLE <another_name>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: