Connecting Tech Pros Worldwide Forums | Help | Site Map

How to publish Stored Procedures into a database

maxamis4's Avatar
Expert
 
Join Date: Jan 2007
Location: Northern VA
Posts: 217
#1: 3 Weeks Ago
Hello folks,

I am not sure if I am using the right terminology so let me explain. I have a database that has multiple stored procedures inside a stored procedure directory in the database. I want to create a new stored procedure and save it inside the same structure. My problem is that every time I create a new stored procedure it saves it as .sql file and it does not show up inside the store procedure directory. How can I save my store procedure so that it shows inside the directory.

I am currently using SQL Server 2005.

Any links and help are always appreciated.

maxamis4's Avatar
Expert
 
Join Date: Jan 2007
Location: Northern VA
Posts: 217
#2: 3 Weeks Ago

re: How to publish Stored Procedures into a database


So this is what I have learned on the web about this issue. Someone please correct me if I am wrong.

To save a stored procedure you must only execute, once executed the procedure is part of the procedure list. If this is inaccurate someone please let me know.
Delerna's Avatar
Expert
 
Join Date: Jan 2008
Location: Sydney
Posts: 790
#3: 3 Weeks Ago

re: How to publish Stored Procedures into a database


I use SQL Server 2000 but....
It sounds like are you writing the stored proc in query analyser and then saving it.

If that is the case then you should be able to do the same as you have done but put

Expand|Select|Wrap|Line Numbers
  1. create proc YourDesiredPocName
  2. as
  3. ....
  4. your code here
  5. ....
  6.  
and then execute it instead of saving it
So long as query analyser is pointing at the correct database ;)


more usually, you need to goto the "stored procedures directory"
and there will be a way to create a new stored procedure there
Possibly, right click on the "stored procedures directory"


hopefully you can gain some help from that
maxamis4's Avatar
Expert
 
Join Date: Jan 2007
Location: Northern VA
Posts: 217
#4: 3 Weeks Ago

re: How to publish Stored Procedures into a database


Thanks I just tried that right before you sent me your information and it worked great!
Reply