Board index » delphi » Restructuring SQL Tables wihout losing data?

Restructuring SQL Tables wihout losing data?

Are their any applications (any) that allow restructuring (changing
the type, size or existence) of an existing column within an SQL table
without losing any of the existing data?

Failing that, what is the best way programmatically, of going about
doing the same procedure?

Any ideas are truly welcome.

-
Steven McKinlay
Real Solutions
Smckin...@realsol.com.au

 

Re:Restructuring SQL Tables wihout losing data?


Quote
smckin...@realsol.com.au (Steve) wrote:
>Are their any applications (any) that allow restructuring (changing
>the type, size or existence) of an existing column within an SQL table
>without losing any of the existing data?

Normally, a SQL frontend should allow you to do this, within certain
limits of course (if you shorten a string field, strings that are too
long will be cut off).

If you want to do it programmatically, then retrieve the original
table's structure (FieldDefs and IndexDefs of the table), create a new
table with the new structure, and batchmove the contents from the old
into the new table.

Marc

Other Threads