开发者

SQL server 2005, Visual Studio 2010 and stored procedures

I am trying to build a database using visual studio. But i saw that you can also use SQL server to do the job with stored procedures开发者_C百科. Is it worth learning SQL server 2005 and stored procedures or can i code SQL straight to the sqlCommand when insert or select data?


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.


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.


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜