Solved

Microsoft SQL Server Express R2 Create stored procedure with parameters

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

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Suggested Solutions

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

732 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