Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Saving a stored procedure by name

Author  Topic 

projecttoday
Starting Member

31 Posts

Posted - 2010-02-22 : 18:49:38
I am a newbie with SQL Server Express 2008 and I'm trying to modify a stored procedure. If I click on Save, it saves to SQLQueryn.sql instead of the current procedure. If I click on Save As I get a popup of sprocs in this database with the default as SQLQueryn.sql and I have to select my sproc from the list. This seems to work okay but I'm afraid I'll accidently select the wrong one sometime and wipe it out. Why can't I just click Save and save it as usual for Windows apps? What am I doing wrong?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-02-22 : 19:44:49
You don't need to save it as that just creates a file. Instead, you run CREATE/ALTER PROC in order to store it inside the database.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

projecttoday
Starting Member

31 Posts

Posted - 2010-02-22 : 20:24:00
Is that done when I do Query/Execute?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-02-22 : 21:14:06
Yes, it's done in a query window.

Saving a stored procedure to a file does not save it to the database, only CREATE (for new ones) and ALTER (for existing ones) do that.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

projecttoday
Starting Member

31 Posts

Posted - 2010-02-22 : 21:20:52
Thanks!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-02-22 : 23:17:14
You're welcome.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-23 : 03:00:08
FWIW: We save all ours to disk too, and then store them in a version control system (SVN). If you have a one-man project that may be overkill, if you have several developers then I think you should consider it
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-23 : 09:27:45
quote:
Originally posted by Kristen

FWIW: We save all ours to disk too, and then store them in a version control system (SVN). If you have a one-man project that may be overkill, if you have several developers then I think you should consider it


I second Kristen on this. This is extremely important when you're working on group project with lots of parallel development happening

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

projecttoday
Starting Member

31 Posts

Posted - 2010-02-23 : 09:35:09
Where can you get a version control system?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-23 : 09:39:11
quote:
Originally posted by projecttoday

Where can you get a version control system?


you need to buy it just like you bought sql server. there're some open source ones too but what we use is MS VSS which requires buying a license.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-23 : 10:25:46
SVN is open source and possibly the most widely used.

There is a Windows front end called Tortoise

Sorry Visakh, but I don't know anyone who has used MS VSS and SVN who would willingly go back to VSS ...

I think I made a post on here about SVN, I'll see if I can find it.
Edit:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=63148
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=73104
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-23 : 10:29:48
quote:
Originally posted by Kristen

SVN is open source and possibly the most widely used.

There is a Windows front end called Tortoise

Sorry Visakh, but I don't know anyone who has used MS VSS and SVN who would willingly go back to VSS ...

I think I made a post on here about SVN, I'll see if I can find it.


I never told they'll go back
I just told what we use

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -