Solved

Microsoft SQL Server Express R2 Create stored procedure with parameters

Posted on 2012-03-25
4
835 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: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:murbro
ID: 37764636
Thanks very much
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

832 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