PDA

View Full Version : Store Procedure یعنی چه ؟



دنی کوئیل
سه شنبه 06 دی 1384, 10:26 صبح
واسه چی و به چه منظور نوشته میشود ؟

M.kavyani
سه شنبه 06 دی 1384, 20:09 عصر
با سلام خدمت شما
من قبلا" سوالی شبیه این رو مطرح کردم که اینجا جواب گرفتم امیدوارم به دردت بخوره
http://www.barnamenevis.org/forum/showpost.php?p=162343&postcount=2
در ضمن دوست دیگری سوالی مطح کرده بودن مشابه تاپیک شما که آقای حامد محمدی اینگونه جواب داده بوند:

سلام

این هم توضیحاتی کوتاه در مورد SP از Books Online:

A stored procedure is a precompiled executable object that contains one or more SQL statements. Stored procedures can have input and output parameters and can issue an integer return code.

Executing a stored procedure is similar to executing a prepared statement, except that the stored procedure exists as a permanently compiled object in the database. A stored procedure can also be used to hide complex SQL statements from the application.

When executing a stored procedure in a Command object, the CommandType property must be specified with the adCmdStoredProc value. With adCmdStoredProc, the corresponding SQL statement for the underlining provider is generated. For applications that use the Microsoft OLE DB Provider for ODBC (MSDASQL), ODBC escape sequences for procedure calls are generated.

There is no need to prepare a statement that calls only a stored procedure. Both stored procedures and prepared statements are methods of precompiling statements. Because a stored procedure is precompiled, preparing a stored procedure call adds overhead. The prepared statement adds a small precompiled execution plan that calls the stored procedure execution plan, rather than executing the stored procedure execution plan directly.



در پناه حق موفق باشید و پرتوان