Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alter table command

Status
Not open for further replies.

inaranjo

Programmer
Sep 17, 2004
7
0
0
EC
Hi every one,

I have to add three fields to a table, but it currently has over 16'000.000 records. Last time this was done (over 9 months ago) the data was backup up with the BCP out command, then the table was recreated with the new fields and a BCP in was performed.
The problem is that with the amount of data it has now the BCP command doesn't work and I don't have a development environment.

Does any ony knows a safelly way to create the new fields?

Thanks in advance,
 
You don't mention what version of ase

Here is one solution
you must have the 'select into' option for the db set.

alter table TestTable
add a integer null
add b char(10) default 'test' -- You must provide default
-- if you don't want nulls
add c datetime null

With that many rows this may take a few minutes and may lock the table. I am curious as to what error you get when trying to bcp out the data?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top