What is a Stored procedure in terms of its execution compared with other solution.can anyone describe in detail about it.
asked Nov 17, 2011 at 03:36 AM in Default
Sql server R2
A stored procedure is nothing more simple than a way to store a query on the server so that lots of different connections can use it over & over. Stored procedures are also parameterized, meaning that they define parameters for input of values, which helps to ensure that once a plan is created for the procedure it can be reused over & over.
There are two other options for queries. You can use parameterized queries, which are a type of ad hoc query that are parameterized like stored procedures. These are almost the same as stored procedures, but are not stored on the system, so they must be generated by the calling application. Finally there are full ad hoc queries. These contain no parameters and are not stored on the system. Their plans are seldom reused and the calling application must maintain this code.
There are lots of other details around all these, but it would take pages and pages to lay it all out. What is that you're trying to get out of open-ended questions like this?
answered Nov 17, 2011 at 04:55 AM
Grant Fritchey ♦♦
Whilst we appreciate your curiosity in SQL Server, open questions like this (and your one relating to indexes) are beyond the scope of a forum such as this. To understand them fully you should access the information available in Books OnLine (http://msdn.microsoft.com/en-us/library/ms187926.aspx). This forum will be more useful to you when you have a specific problem or have a task that you are unable to complete. We will then be able to suggest specific options based on our experience and knowledge of SQL Server.
Please keep asking questions but keep in mind that answers here will not be able to cover a whole topic, especially when there are better resources already available elsewhere