Solved

Microsoft SQL Server Express R2 Create stored procedure with parameters

Posted on 2012-03-25
4
842 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:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:bbao
bbao 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:Murray Brown
ID: 37764636
Thanks very much
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

691 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