March 16th, 2012, 07:28 AM
Difference between a query and strored procedure
can anybody solve the problem that what is the Difference between a query and strored procedure?
Thanks & Regards
March 19th, 2012, 09:06 AM
Query & Stored Procedure
Query and Stored procedure both are same but,
1.When you compile the code each and every time the compiler check the query where stored procedure first time checks and next time onward it will execute i.e(precompiled block of code stored procedure)
2.During Execution Each and every query Its time taking where as storedprocedure Not Time taking
3.In Query if you want to modify you want to edit the code , compile and Execute the code.where Stored procedure Just modify using Alter
March 29th, 2012, 02:07 AM
Store procedure will not compile again and again while simple Query compile each time and then execute.
August 14th, 2012, 06:38 AM
Query and stored procedure do the same thing but the difference is that a query ought to be compiled every time the query is executed, while the stored procedure is in compiled form when executed first time. I f they use stored procedure they can avoid recompilation of the query.
August 17th, 2012, 04:52 AM
Query and SP
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 only 1 statement. Stored Procedure:
In Stored Procedure we can execute Batch of Queries