SQL Server 2005、Visual Studio 2010 和存储过程

发布于 2024-11-07 16:16:42 字数 1428 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

时光清浅 2024-11-14 16:16:42

最好学习新东西。所以你必须学习SQL Server和存储过程,因为编写存储过程是程序员必须学习的。

It is better to learn new things. So you must learn SQL Server and STORED PROCEDURE because writing stored procedure is must to learn for a programmer.

凉城已无爱 2024-11-14 16:16:42

任何一种方法都会有效。

已经有 SO在这里发布讨论这两种方法的好处。

鉴于您必须已经具备一些 SQL DML 知识,您可以编写插入、选择和更新代码,为什么不进一步了解更多呢。根据我的经验,SQL 是在我的职业生涯中保持相对稳定的一种语言。

Either approach will work.

There is already a SO Post here discussion the benefits of either approach.

Given that you must already have some SQL DML knowledge, you can code inserts, selects and updates, why not go further and learn more. In my experience SQL has been the one language which has remained relatively constant throughout my career.

感情旳空白 2024-11-14 16:16:42

我相信学习存储过程是一项宝贵的技能。我见过开发人员在进行数据操作时编写了数百行代码,而这些代码本来很容易用 SQL 语句表达并作为存储过程运行。

I believe learning stored procedures is a valuable skill. I've seen developers write hundreds of lines of code when to do data manipulations that would have been simple to express in a SQL statement and ran as a stored procedure.

岁月苍老的讽刺 2024-11-14 16:16:42

我的理解是,存储过程(“sproc”)通常比等效的内联 SQL 更高效,因为它们是由数据库引擎预先优化的。

此外,您可以使用存储过程执行多个操作,并包含难以通过内联代码有效执行的条件逻辑。

就实现数据逻辑而言,存储过程是一个明智的选择。虽然您可以完成许多您可能想要在线执行的操作,但数据库引擎是专门设计用于非常非常高效地执行某些类型的操作。存储过程使您能够将与数据访问相关的繁重工作推到其所属的位置(在服务器上),并让您的客户端代码执行 IT 应该执行的操作。即,将业务规则应用于数据的使用。

我强烈建议您花一点时间学习 SQL Server Management Studios (SSMS) 和存储过程的构建。

My understanding is that Stored Procedures ("sproc's") are often more efficient than the equivelent in-line SQL, because they are pre-optimized by the database engine.

Further, you can perform multiple actions with a stored procedure, and include conditional logic that is difficult to do effectively from in-line code.

In terms of implementing da logic, an sproc is a sensible place to do it. While you CAN accomplish many of the things you might want to do in-line, the database engine is specifically designed to perform certain types of operation very, very efficiently. Stored Procedures enable you to push the heavy lifting related to data access where it belongs (on the server) and keep your client code doing what IT is supposed to do. Namely, applying business ruiles to the use of the data.

I strongly recommend investing a little time learning your way around SQL Server Management Studios (SSMS) and the construction of Stored Procedures.

薔薇婲 2024-11-14 16:16:42

在大多数情况下,与内联查询相比,使用存储过程是更好的选择。如果您想制作使用数据库的应用程序,那么掌握存储过程并至少对 SQL Server 有一定的了解非常重要。希望我能回答你的问题。

Using Stored Procedure in contrast of inline query is a better option in most of the cases. And if you want to make application that uses a database, it is important for you to have hands on Store procedures and atleast some understanding of SQL Server. Hope I answer your question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文