Monday, September 12, 2011

Stored Procedure Overview for Database Testers

A stored procedure is a set of SQL commands that has been compiled and stored on the database server. For Separate kind of functionalities  you can create different procedures. like InsertRecord to insert that data row and DeleteRecord to delete the data row.
A stored procedure is a set of one or more SQL statements that are stored together in database.
Stored Procedure Overview for Database Testers
How to create Store Procedure:
CREATE PROCEDURE MyStoredProcedure AS
SELECT Products.ProductName AS TenMostExpensiveProducts, Products.UnitPrice
FROM Products
ORDER BY Products.UnitPrice DESC
Modify Store Procedure:
ALTER PROCEDURE MyStoredProcedure AS

SELECT Products.ProductName AS TenMostExpensiveProducts, Products.UnitPrice, Products.NoOfUnits
FROM Products
ORDER BY Products.UnitPrice DESC

Running a Store Procedure:
EXEC MyStoredProcedure

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

 
Powered by Blogger