471,066 Members | 1,289 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Need to add a new column to an existing table with 37M rows

I have been trying a couple of methods to add a column to a table. Well adding the column hasnt been that difficult. The difficult part is when I need to update this newly added column with a value returned from a function. Even 1000 rows takes for ever to update in a transaction. Is there any one who has come across this stituation, please help.

Thanks in Advance.
Oct 1 '07 #1
1 1078
ck9663
2,878 Expert 2GB
I have been trying a couple of methods to add a column to a table. Well adding the column hasnt been that difficult. The difficult part is when I need to update this newly added column with a value returned from a function. Even 1000 rows takes for ever to update in a transaction. Is there any one who has come across this stituation, please help.

Thanks in Advance.

am not sure there are other ways...maybe you could benchmark your UPDATE vs SELECT ...newfield = udf(para) into ... from...

depending on table that your updating (may have triggers, constraint). the cons of SELECT...INTO is also space on your db.

also, try if you can just use a CALCULATED FIELD. another one is to just use a function outside of db, that is if you don't need to keep this field and will be used primarily for display purposes.
Oct 1 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by rufpirat | last post: by
reply views Thread by ward | last post: by
6 posts views Thread by Hemant Shah | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.