Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 When to use stored procedure and Query

Author  Topic 

visharaddhavle83
Starting Member

1 Post

Posted - 2010-05-07 : 14:44:59
Hello,

I am confused where to use Stored Procedure and when to use queries.

I heard that it is not always necessary to use stored procedure every time. So thats the reason i m confused.

Please Help !!

Thank u.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-05-07 : 14:53:07
stored procedures are used mostly cases where you need to generalise the logic and then call it based on specific values by passing as parameters . for adhoc cases you simply write them as query as no resuse is reqd

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

sathiesh2005
Yak Posting Veteran

85 Posts

Posted - 2010-05-08 : 02:55:44
Stored procedures are compiled code, it can run faster than a query. If you are doing a reusable code then you can write it in a stored procedure and call them when necessary.

Regards,
Sathieshkumar. R
Go to Top of Page
   

- Advertisement -