Solved

Microsoft SQL Server Express R2 Create stored procedure with parameters

Posted on 2012-03-25
4
832 Views
Last Modified: 2012-03-26
Hi

I have just downloaded SQL Sever Express 20008 and wanted to build my first stored
procedure with parameters. I take it that I do this in Management Studio. Not sure
where to start or how to do this.

Thanks
0
Comment
Question by:murbro
4 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 167 total points
ID: 37762885
1. Click on New Query.
2. Make sure you are in the right database (change if necessary by using the drop down or USE databasename.
3. Enter your Stored Procedure:
CREATE PROCEDURE dbo.usp_MyProc
    @Param1 integer,
    @Param2 integer
AS 

SET NOCOUNT ON

SELECT  @Param1 Param1,
        @Param2 Param2

Open in new window

0
 
LVL 22

Assisted Solution

by:8080_Diver
8080_Diver earned 167 total points
ID: 37763980
Personally, I think a better approach would be to right click on the Programmability/Stored Procedures and select NEW.  The should bring up a template for the stored procedure.  You can either start working on it immediately or depress <Ctrl><Shift><M> to pop up a dialogue that will let you fill in some information that will jump-start your stored procedure.
0
 
LVL 37

Assisted Solution

by:Bing CISM / CISSP
Bing CISM / CISSP earned 166 total points
ID: 37764095
FYI

the essentials for SQL

SQL Server Stored Procedure Basics
http://www.informit.com/articles/article.aspx?p=25288&seqNum=9

the advanced for SQL2K8:

Passing table valued parameters in SQL Server 2008
http://www.techrepublic.com/blog/datacenter/passing-table-valued-parameters-in-sql-server-2008/168
0
 

Author Closing Comment

by:murbro
ID: 37764636
Thanks very much
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now