Integer to Bigint datatype conversion

Database
Enthusiast

Integer to Bigint datatype conversion

Is there any alter table (or any other sql) command that can be used to alter the datatype of a integer column to bigint? I have a bunch of tables in a shared environment all of which have data and I need to update the datatype for one column in all of these tables. I could not find a sql so I've been using the usual procedure of creating a new table, copying over data and replacing the old table - just wondering if there is an easier way out.
2 REPLIES
Enthusiast

Re: Integer to Bigint datatype conversion

That can't be done with a single ALTER TABLE command. The SQL manual is your friend. See the topic "Rules for Changing the Column Data Types" and "Procedure to Change Column Data Types" in the section on ALTER TABLE.

Enthusiast

Re: Integer to Bigint datatype conversion

Thanks for the confirmation Jim.