SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Saving a stored procedure by name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

projecttoday
Starting Member

31 Posts

Posted - 02/22/2010 :  18:49:38  Show Profile  Reply with Quote
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

USA
37466 Posts

Posted - 02/22/2010 :  19:44:49  Show Profile  Visit tkizer's Homepage  Reply with Quote
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 - 02/22/2010 :  20:24:00  Show Profile  Reply with Quote
Is that done when I do Query/Execute?
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37466 Posts

Posted - 02/22/2010 :  21:14:06  Show Profile  Visit tkizer's Homepage  Reply with Quote
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 - 02/22/2010 :  21:20:52  Show Profile  Reply with Quote
Thanks!
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37466 Posts

Posted - 02/22/2010 :  23:17:14  Show Profile  Visit tkizer's Homepage  Reply with Quote
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

United Kingdom
22431 Posts

Posted - 02/23/2010 :  03:00:08  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 02/23/2010 :  09:27:45  Show Profile  Reply with Quote
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 - 02/23/2010 :  09:35:09  Show Profile  Reply with Quote
Where can you get a version control system?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 02/23/2010 :  09:39:11  Show Profile  Reply with Quote
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

United Kingdom
22431 Posts

Posted - 02/23/2010 :  10:25:46  Show Profile  Reply with Quote
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

Edited by - Kristen on 02/23/2010 10:40:59
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 02/23/2010 :  10:29:48  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.1 seconds. Powered By: Snitz Forums 2000