Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Parameters in a Stored Procedure 1

Status
Not open for further replies.

MattN

Programmer
Jan 21, 2002
29
GB
Can anyone give me a sample of a very simple stored procedure which uses a parameter i.e. OrderNo

This would be most helpful to get me started. I will figure out the rest.

Kind Regards

MattN


 
If you still have the 'pubs' database on your install...

CREATE PROCEDURE byroyalty @percentage int
AS
select au_id from titleauthor
where titleauthor.royaltyper = @percentage


GO

...this stored proc is still there.

Execute the stored proc...

EXEC byroyalty @percentage = 100

 
So simple when you know how.

Now I can progress to the more complex.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top