Solved

How to create a stored procedure in sql 2005?

Posted on 2008-10-16
3
258 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

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…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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