SQLServer和C#代码 [英] Sqlserver and C# code

查看:85
本文介绍了SQLServer和C#代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


谁能告诉我哪种方法更有效..

用数学运算编写存储过程或用数学运算分别编写代码文件??

Hi,
Can anybody tell me which is more effective practice..

Writing a stored procedure with math operations or writing the code file separately with math operations??

推荐答案

总是最好在数据库中进行过滤,这样" s可以优化数据库.
It is ALWAYS better to do your filtering in the database, that''s what databases are optimised to do.


这取决于您的选择.

如果您想经常访问数学运算,那么最好制作一个类并在其中定义所有运算.

如果您希望业务逻辑保留在SP中,那么您也可以这样做.这样做的好处是,一旦交付了应用程序并且数学运算中将发生任何更改,那么您只需要更新数据库即可.

每个选项都有自己的优缺点.


HTH
It depends on your choice.

If you want to access your math operations frequently then it is better to make one class and define all operations inside it.

If you prefer you business logic to kept in SP then you can do that also. The advantage of it is that once you deliver your application and any change will occurs in math operations then you need to update only DB.

Each options has it''s own pros and cons.


HTH


这篇关于SQLServer和C#代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆