943,917 Members | Top Members by Rank

Ad:
  • MS SQL Discussion Thread
  • Marked Solved
  • Views: 1863
  • MS SQL RSS
Apr 2nd, 2009
0

proper Save location for SQL stored procedures

Expand Post »
I saved a few stored procedures in SQL Server Management Studio. The default Save location, which I accepted, was C:\Documents and Settings\BobLewiston\My Documents\SQL Server Management Studio\Projects. (And yes, each stored procedure was in the form of an .sql file, and I assigned each file name root to be the same as the contained procedure's name.) But this Projects folder must be the wrong place, because my apps aren't finding these stored procedures.

I see a lot of .sql files in various places on my hard drive, but I can't find any by the names of the stored procedures listed in Management Studio's Stored Procedures folder (none of which I wrote). For that matter, I'm not even finding the Stored Procedures folder on my hard drive.

Where are stored procedures SUPPOSED to be saved?
Reputation Points: 10
Solved Threads: 0
Junior Poster
BobLewiston is offline Offline
105 posts
since Nov 2008
Apr 3rd, 2009
0

Re: proper Save location for SQL stored procedures

Stored procedures need to be created using the CREATE PROCEDURE statement and then executed (F5 or the green play button in the toolbar). They are compiled and stored in the database itself. If you choose save in the Mangement Studio file menu this is just a convenient way to save your TSQL as a text file for use elsewhere, or to send to someone else, or to re-create it as part of a deployment script if you want to set up the same database on another Sql Server instance.
Last edited by hollystyles; Apr 3rd, 2009 at 9:26 am.
Reputation Points: 262
Solved Threads: 68
Veteran Poster
hollystyles is offline Offline
1,181 posts
since Feb 2005
Apr 3rd, 2009
0

Re: proper Save location for SQL stored procedures

Thanks, problem solved. It turns out that although I had been told to save stored procedures via Ctrl-F5, it's actually F5. Again, thanks.
Reputation Points: 10
Solved Threads: 0
Junior Poster
BobLewiston is offline Offline
105 posts
since Nov 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS SQL Forum Timeline: sp_changedbowner question
Next Thread in MS SQL Forum Timeline: Need help with SQL update query





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC