Register now or log in to join your professional community.
If you mean to say difference between a SQL query and SQL stored procedure, I am differentiating it below.
Every query is submited it will be compiled & then executed.where as stored procedure is compiled when it is submitted for the first time and this compiled content is stored in something called procedure cache, for subsequent calls no compilation,just execution & hence better performance than query. In Query we can execute only1 statement. In Stored Procedure we can execute Batch of QueriesAdvantage in Programming - If you are using Query in your program exe, want to change Query, you have to change query and compile it again. But if used Stored procedure, no need to recompile just modify the SP. Query is slow and SP is fast.
P.S: by SP I mean Stored Procedures. If this is something actually suppose to differentiate query with stocked procedure, please discard my answer as I haven't heard that term before
Thanks
Thanks
The diffrence between query and stocked procedure is:
Query: The phase that identifies an efficient execution plan for evaluating a query that has the least estimated cost is referred to as query optimization.
Stoked procedure: A stored procedure is a named group of SQL statements that have been previously created and stored in the server database.
Query and stored procedure do the same thing but the difference is that a query should be compiled everytime the query is executed,while the stored procedure is in compiled form when executed first time. If we use stored procedure we can avoid recompilation of the query.