|
here is the simplest hello world create stored procedure for beginner. Ideally
its not hello world create stored procedure. Its a simple stores procedure
that creates an sp and return data from a table named HELLOWORLD
CREATE PROCEDURE usp_test
AS
BEGIN
SELECT * FROM HELLOWORLD
END
GO
Note
usp_test is the name of the stored procedure u are creating, it could be abc or any other name
HELLOWORLD is a table on the database with fields HELLOWORLDID and HELLOWORLDNAME
So to try this program create a database. create a table named HELLOWORLD, with fields above fill in some data
then right click on in the sql Server
Database->YourDatabase->Programmability->StoreProcedure
Right Click : Select New Stored procedure
Copy Paste above script
Click on Execure
now to run the sp u have just created
Open Query Analyzer
exec usp_test
Click on execute
Here u go :)
|