Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 269
  • Last Modified:

How to create a stored procedure in sql 2005?

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
lapucca
Asked:
lapucca
2 Solutions
 
BrandonGalderisiCommented:
create procedure YOURPROCEDURENAME
as

print 'This is your procedure'

-- do stuff here
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>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
 
lapuccaAuthor Commented:
Yeah, but I can only save it as a query when I click to save it in the query editor though.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now