Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie question on creating SP?
Message
 
 
To
01/09/2006 10:39:29
Keith Payne
Technical Marketing Solutions
Florida, United States
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01150360
Message ID:
01150417
Views:
25
>
>Dmitry,
>
>The best way to create a stored procedure in SQL 2005 is to click on the New Query button (top left) and begin typing. If you absolutely need to use a template, drag one from the template explorer into the content pane and press Ctrl-Shift-M within the new query to bring up the template substitution dialog.
>
>The reason that Procedure_name & ProcedureName is in there twice is because it is a placeholder for what you type into the subsitution dialog. The first Procedure_name is the substitution "variable", sysname is the datatype, and ProcedureName is the default value.
>
>To execute the stored procedure, add a line like
>
EXEC Myprocedure 'Hello', 10, '20060901'
to the commented header block. Then after running the entire create script with F5, highlight the EXEC line and hit F5 again. It will run whatever is highlighted.

Keith,

When I follow your suggestion to click on New Query and so on and when I click on Save(after I type the Stored Procedure) I am prompted to save the query in a Projects folder as a .SQL file. Is this how Stored Procedures are saved?

Also, I stopped at a book store at lunch and looked at a book on SQL Server 2005. They have description of how to create a Stored Procedure, but in the book on Right-Click instead of a Template it was showing a different screen when you enter name of the procedure and a few other options. If someone knows how my SQL Server Manager brings a different window, please let me know.

Thank you very much for your help.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform