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.

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:
SELECT Products.ProductName AS TenMostExpensiveProducts, Products.UnitPrice, Products.NoOfUnits
FROM Products
ORDER BY Products.UnitPrice DESC
Running a Store Procedure:
A stored procedure is a set of one or more SQL statements that are stored together in database.
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