• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 705
  • Last Modified:

Alter Column from Integer to Bigint

Hi,

I am trying to alter a column from integer to bigint, but ia m not able to do so. That particular column is a Foreign Key.

Kindly me out with the solution, so that I can solve the problem Immd.

Thanks & Regards,
Pasha S...
0
siraj_pasha
Asked:
siraj_pasha
1 Solution
 
yongsingCommented:
The only type of column you can alter is VARCHAR. Since your column is integer, you can't alter it. What you can do is to export out the data, recreate the table with the new column definition, and import the data back into the table.
0
 
siraj_pashaAuthor Commented:
Hi yongsing,

Isn't there anyway other that this....
This is a Last minute change by the Client,
so I need to do the changes Immed.
that particular column is taken care by the trigger's...

If U find anyother solution pl. do tell me...

Thanks & Regards,
Pasha S...
0
 
siraj_pashaAuthor Commented:
Hi yongsing,

Isn't there anyway other that this....
This is a Last minute change by the Client,
so I need to do the changes Immed.
that particular column is taken care by the trigger's...

If U find anyother solution pl. do tell me...

Thanks & Regards,
Pasha S...
0
 
mglxxxCommented:
The only other way to do this is somewhat similar
to yongsing's approach:

Create a table which is structurally identical to
the table where you need the bigint column but
which contains the bigint column (i.e. the
structure of that table is as you want the
original table to be).

Copy all data from the original table to the new
table.

Drop the old table.

Rename the new table to the old table.

Recreate any indexes or triggers on the table.
0
 
k_murli_krishnaCommented:
siraj_pasha, please pardon me for this. mglxxx - I have posted points for you questions totalling 750 points. They are in:
http://www.experts-exchange.com/Databases/IBM_UDB/Q_20552305.html

http://www.experts-exchange.com/Databases/IBM_UDB/Q_20551701.html

Please claim what you most deserve.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now