?
Solved

Alter Column from Integer to Bigint

Posted on 2003-02-27
7
Medium Priority
?
701 Views
Last Modified: 2008-03-10
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
Comment
Question by:siraj_pasha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 9

Expert Comment

by:yongsing
ID: 8040074
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
 

Author Comment

by:siraj_pasha
ID: 8040767
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
 

Author Comment

by:siraj_pasha
ID: 8040807
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
 
LVL 9

Accepted Solution

by:
mglxxx earned 400 total points
ID: 8041462
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
 
LVL 17

Expert Comment

by:k_murli_krishna
ID: 8157208
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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question