How to create a Store_procedure On the Server From SSMS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • syedshaffee
    New Member
    • Jan 2012
    • 91

    How to create a Store_procedure On the Server From SSMS

    Hi People,

    How to create a Store_procedure On the Server From SSMS

    Please Give me The Syntax of it
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    The basic syntax is
    Code:
    CREATE PROCEDURE ProcedureName
    	-- Add the parameters for the stored procedure here
    AS
    BEGIN
        -- Insert statements for procedure here
    END

    Comment

    • syedshaffee
      New Member
      • Jan 2012
      • 91

      #3
      Thanx Rabbit i tried that But the Procedure is not saved when Checked Under "Programmabilit y" Please Help and when i clicked on save it is Shows to save it on my Local machine. i want it to be saved on the server. Please be gentle in am new in this "Creating Store Procedure"

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        If there are no error messages and it says it ran correctly, then it got created somewhere. Make sure you're in the correct database. And after you run a create, it doesn't automatically refresh the list of stored procedures, you have to manually refresh it by right clicking the stored procedure folder and clicking refresh. It may also be the case that you don't have the permissions to view the stored procedures, in which case you will have to talk to the database admin.

        When you click save, that's just save the code, it's a text file basically. That doesn't create a stored procedure.

        Comment

        • syedshaffee
          New Member
          • Jan 2012
          • 91

          #5
          Thanx a Lot rabbit for your reply

          Comment

          • PsychoCoder
            Recognized Expert Contributor
            • Jul 2010
            • 465

            #6
            Another option is to right-click on Stored Procedures and select to add a new stored procedure like in the attached image:

            [IMGnothumb]http://psychocoder.net/new_sproc.png[/IMGnothumb]
            Last edited by PsychoCoder; Nov 5 '12, 08:28 PM. Reason: [z(tried fixed image path and to show - twice :) )]

            Comment

            • zmbd
              Recognized Expert Moderator Expert
              • Mar 2012
              • 5501

              #7
              PsychoCoder
              Please take a look at your profile, profile settings, attachments and double check the path to the file you uploaded... I can't seem to get at it to fix your post.

              Comment

              Working...