Solved

How to create a stored procedure in sql 2005?

Posted on 2008-10-16
3
256 Views
Last Modified: 2010-03-20
Hi, In MS SQL Server Management Studio, I clicked File and New but it only offer to create Query.  
1.  How can I create a stored procedure?  Do I just type Create Procedure in the Query editor?
2.  How do I name the stored proecude?  Internet example of dbo.xxxx.  Do I use my login-name.procedure-name?  Or can I just give it a prcedure name like MyProcedure?

Thank you.
0
Comment
Question by:lapucca
3 Comments
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 300 total points
ID: 22735967
create procedure YOURPROCEDURENAME
as

print 'This is your procedure'

-- do stuff here
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 200 total points
ID: 22735977
>Do I just type Create Procedure in the Query editor?
yes

or

go to the database, choose the programmability -> stored procedure, and right-click and choose "new" there.
0
 

Author Comment

by:lapucca
ID: 22736111
Yeah, but I can only save it as a query when I click to save it in the query editor though.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Select Query problems 10 46
SQL Round a percentage 2 23
Passing value to a stored procedure 8 68
Oracle Subquery bad Join 11 43
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

22 Experts available now in Live!

Get 1:1 Help Now