If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > updating new column in sybase

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-22-11, 01:31
mad_man12 mad_man12 is offline
Registered User
 
Join Date: Mar 2011
Posts: 6
updating new column in sybase

Hi All,

I am facing a problem to update the new column in sybase

My sybase version is 11.0.3
I have to add a new column in a table having around 90 million records

Now i have to update this column with a default value of 3
Now i know there is no way in current sybase version to set a default value with a new column, i have to update the column with the value of 3, but just becuase of large size of table it is taking more than 2 days to update the column.

i am first capturing the an indexed column of the table in the cursor and
then updating the new column in the table using this indexed column
Please can i have any bright ideas how to update the column as quickly.

Thanks in Advance!!
Reply With Quote
  #2 (permalink)  
Old 12-23-11, 10:28
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
Don't use a cursor.
update in batches e.g. where key between 1 and 10000000 depending on your log size
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On