Nov 24

This topic describes how to create a Transact-SQL Stored Procedure by using Object Explorer in SQL Server Management Studio and provides an example that creates a simple stored procedure.

To create a stored procedure

  • Open Microsoft SQL Server 2005 >> SQL Server Management Studio.
  • In Object Explorer, connect to an instance of SQL Server 2005 Database Engine and then expand that instance.

Alomohora - Microsoft SQL Server - Create Stored  Procedure1

  • Expand Databases, expand the database in which the stored procedure belongs, and then expand Programmability.

Alomohora - Microsoft SQL Server - Create Stored  Procedure2

  • Right-click Stored Procedures, and then click New Stored Procedure.
  • On the Query menu, click Specify Values for Template Parameters.
  • In the Specify Values for Template Parameters dialog box, the Value column contains suggested values for the parameters. Accept the values or replace them with new values, and then click OK.

Alomohora - Microsoft SQL Server - Create Stored  Procedure3

  • In the query editor, replace the SELECT statement with the statements for your procedure.
  • To test the syntax, on the Query menu, click Parse.
  • To create the stored procedure, on the Query menu, click Execute.
  • To save the script, on the File menu, click Save. Accept the file name or replace it with a new name, and then click Save.
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Twitter

Related posts:

  1. The CREATE TABLE Statement
  2. The CREATE DATABASE Statement
  3. Creating a Simple Application
  4. Sql Server 2005 Can’t Start
  5. Northwind Database Installation

Leave a Reply