Yes, there is a performance advantage for a select statement in a stroed
procedure.  99% of the execution time comes from formulating the execution
plan, which the sql engine caches for stored procedures.

>> Should views be used?

You lose the performance benefit; same as inline-SQL.  More useful for
encapsulating complex joins, or by managing rights through SQL server
permissions.

>>What's the threshold of savings when using stored procedures?
Whatcha mean?


I'm not sure why there is no wizard for select stored procedures.  But if
you look at it, the wizard creates them at a table level, so all it would
really come up with would be a "select * from whatever".

Usually, I just create the query in a view, save the view for
reference/modifications down the line, and then just cut and paste the
select statement into a proc.

HTH,

Matthew P. Smith 
Web Developer, Object Oriented 
Naval Education & Training Professional 
Development & Technology Center 
(NETPDTC) 
(850)452-1001 ext. 1245 
[EMAIL PROTECTED] 


>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:mdinowit@;houseoffusion.com]
>>Sent: Sunday, November 10, 2002 6:37 PM
>>To: SQL
>>Subject: SP creation
>>
>>I was looking at the SQL 2k stored procedure wizard and noticed that it
>>does not
>>have anything for select. I was under the impression that a select based
>>stored
>>procedure would be quicker than a non-stored procedure version. Was I
>>wrong? Is
>>there a different way to set them up with the wizard? Should views be
>>used?
>>What's the threshold of savings when using stored procedures?
>>(I've used them in the past with earlier versions of SQL but I'm unsure of
>>any
>>changes in 2k and efficiency)
>>Thanks
>>
>>Michael Dinowitz
>>Master of the House of Fusion
>>http://www.houseoffusion.com
>>
>>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=6
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=6
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to