Home  /  Questions  /  Question



63   95.7
Apr 16, 2010


Stored Procedures

Where do I find information on using stored procedures with parameters instead of the inline sql statements?
 1 comment
 
Sorry, I should have been more clear. Is there examples on how to use stored procedures with parameters within the 'Db' class of the framework? --- Jonathan Patrick  May 03, 2010



340   99.9
Apr 27, 2010
Good information on Stored Procedures is available in the following link

http://support.microsoft.com/kb/306574


Thanks,
Chinna Srihari
 1 comment
 
Great link, thanks! --- Jonathan Patrick  May 03, 2010

330   99.9
Apr 25, 2010
SQL statement :

SELECT Product, Quantity
  FROM Inventory
 WHERE Warehouse = 'FL'
Stored procedure:

CREATE PROCEDURE sp_GetInventory
  @location varchar(10)
AS
SELECT Product, Quantity
  FROM Inventory
 WHERE Warehouse = @location

To call this Stored Procedure:  

EXECUTE sp_GetInventory 'FL'
For more information check this link: http://databases.about.com/od/sqlserver/a/storedprocedure.htm

I hope this helps.