- Computer Using
- Windows
- Browser
- How-To
- Microsoft Office
- MS Word
- MS Excel
- MS Outlook
- MS PowerPoint
- Graphic / Design
- Photoshop
- Illustrator
- Server & Network
- Computer Networking
- Internet
- Windows Server
- Web Development
- HTML
- Javascript
- CSS
- ASP.NET
- PHP
- Animation
- Flash
- Silverlight
- Database
- Database System
- SQL Server
- T-SQL
- XML
- XML
How To Create Store Procedure in SQL Server 2005
Create Store Procedure
- Right click on Store Procedure and then click on New Stored Procedure...
- Click on Query menu and then click on Specify Values for Template
Paramenter...
- Enter your name, date you created, Description, Stored Procedure Name, parameter
and data type of parameter. And then click Ok button.
- Alter your SQL Statement like below:
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE spGetProductByID @ProductID int AS BEGIN SET NOCOUNT ON; SELECT ProductName, Price FROM tblProduct WHERE ProductID=@ProductID END GO
Or Alter it like in picture:
- Select your database and click Execute button
Call Stored Procedure
- Click on New Query
- Write SQL Statement like below:
EXEC dbo.spGetProductByID @ProductID=2
- Select your database and click Execute button
- here is your result after your execute it.

