[英]Updating millions of Row after Calculation
I am looking for advice on how should I do following:我正在寻求有关我应该如何执行以下操作的建议:
Now I want to update them into database with most efficient manner.现在我想以最有效的方式将它们更新到数据库中。 Options I know are
我知道的选项是
I am not sure which method is faster one or better one.我不确定哪种方法更快或更好。 Any idea?
任何的想法?
EDIT : Why I am afraid of using Stored Procedure编辑:为什么我害怕使用存储过程
Thanks.谢谢。
如果您有一个字段包含来自数据库中其他字段的计算,最好将其设为计算字段或通过触发器维护它,以便在任何来源更改数据时,都会保留计算。
You can create a .net function which can be called directly from sql here is the link how to create one http://msdn.microsoft.com/en-us/library/w2kae45k%28v=vs.90%29.aspx .您可以创建一个可以直接从 sql 调用的 .net 函数,这里是如何创建一个http://msdn.microsoft.com/en-us/library/w2kae45k%28v=vs.90%29.aspx的链接。 After you created the function run the simple update statement
创建函数后,运行简单的更新语句
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.