Stored procedures a compiled versions SQL statements. Performance benefits are
significant as network traffic is reduced, and the optimizer does not need to
re-parse the code.
/* stored procedure to retrieve an invoice */
create procedure proc_rtv_invoice (@inv_id numeric(8,0) as
select inv_id, inv_date, salesrep_emp_id
from invoice
where inv_id = @inv_id
return
go
/* now, execute the stored procedure */
exec proc_rtv_invoice 325
go
|
|