Monday, December 3, 2007

How to create a Stored Procedure

How to create a Stored Procedure

    A new stored procedure can be created by using the following command in SQL Query Analyzer.

    Step 1

    Type in the following command in there.

    CREATE PROCEDURE DemoStoredProcedure

    AS

    SELECT ''

    SELECT *

    FROM Employees

    FOR XML AUTO

    SELECT ''

    GO

Step 2

Right after that press F5 to run it. Please make sure that you are using the right Database for your stored procedure creation.

No comments: