473,748 Members | 9,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Saving changes

Hi, all.

This might be a silly question... but I am very new to programming in
SQL so please bear with me :)

So. I'm using MS SQL Server 2005 Management Studio Express. I have a
table that was created via an existing .sql file. Included were a
bunch of stored procedures. I went in to re-format these procedures.
(They were written in haste by another programmer. It is my task to go
back and improve their readabilities.) However, I am having difficulty
figuring out how to save the changes to these stored procedures. Thus
far, I have been individually saving each stored procedure in its
own .sql file. This is obviously not the way to go... but it's a
temporary solution (so as not to lose the changes I have made to
dozens of procedures).

Can someone please explain to me how I commit these changes to the
database?

Thanks,
Allie
Nov 20 '07 #1
1 2038
Allie (fa**********@g mail.com) writes:
So. I'm using MS SQL Server 2005 Management Studio Express. I have a
table that was created via an existing .sql file. Included were a
bunch of stored procedures. I went in to re-format these procedures.
(They were written in haste by another programmer. It is my task to go
back and improve their readabilities.) However, I am having difficulty
figuring out how to save the changes to these stored procedures. Thus
far, I have been individually saving each stored procedure in its
own .sql file. This is obviously not the way to go... but it's a
temporary solution (so as not to lose the changes I have made to
dozens of procedures).
I think that is exactly the way to go. You should also put the files under
source control.
Can someone please explain to me how I commit these changes to the
database?
But that's not saving. You save a file to the file system, and as I said,
you also put it under version control.

To change the database what's in the database is more akin to a compilation.
To make this easy to handle, I suggest that you have this in your files:

IF object_id('my_s p') IS NULL
EXEC ('CREATE PROCEDURE my_sp AS SELECT 1')
go
ALTER PROCEDURE my_sp -- real code follows here

Then it doesn't matter when you run the file, whether the procedure
exists or not.

And to run the file from Mgmt Studio, you can clich the green arrow,
or press CTRL/E or F5.

When you need to load several files, this is more convenient to do
from a BAT file and use SQLCMD instaead.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Nov 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5643
by: John | last post by:
(access 2002) Anyone have any suggestions as to what may be causing access to not save form changes after I "tell" it to, exit database, then re-open later to discover the changes had not been saved (or somehow reverted). BUT, new form module code is saved. Example: created txtTitle control on form. Create AfterUpdate event code for txtTitle. Save form. Close database. Later...Open database, open form, txtTitle not there but its event...
7
2367
by: MacDermott | last post by:
For a client who wants answers, but doesn't want to bother to learn Access, I've built a cut-down query generator, where they can select fields and criteria. I then compose the appropriate SQL SELECT statement and assign it to a fixed query name. ( qryTemp.SQL= MySQLString) qryTemp is the SourceObject for a subform on a form which I then open. (Note that the query itself is the source object, not a form based on it.) So far, this works...
2
1827
by: manning_news | last post by:
Has anyone had a problem with Access 2003 not saving their coding? I've been using 2003 for a couple of months now and just this week noticed that some coding I'd done for a database was not there anymore. I reentered it and didn't have any problems for a couple of days. Today I entered some coding, saved it, opened another database, and when I opened my original database again, the coding I had entered was missing. Access 2000 always...
4
1047
by: Jager | last post by:
Ok, I've got a program I am working on that is supposed to save all changes to the dataset to the actual database, but this doesn't seem to be working. I used the DataAdapter.Update(DataSet) method, but that doesn't save the changes to my actual database. How can I go about updating the actual database to save changes? Please help, Jager
6
3517
by: NutsAboutVB | last post by:
Hello, I am a .NET programmer and I have a JPEG image file (from digital camera) of about 109 KB's in size, when I open it and save it (without making any alterations at all, just going to File --> Save) in MS Photo Editor, the file is automatically shrunk in size to 81 KB's. When doing the same thing in MS Paint, the file is shrunk to 54 KB's. The file has the same number of pixels after both saves (as expected). My question follows...
11
27318
by: Kevin | last post by:
I've been searching forever for examples of saving data changes in a DataGridView. There's all kinds of examples, but none really show how to save changes. Someone please help me. I have a Windows Forms program with a DataGridView and a BindingSource added to a form. Here is the code I'm using to populate the grid: Dim CRClassesTableAdapter As SqlDataAdapter Dim CRClassesTable As New DataTable()
5
7356
by: deekay | last post by:
I want to allow users to resize and reposition columns of a datasheet but for a prompt to be brought up and only the layout only to be saved if they select "save changes". This is the way it works at the moment for queries but for datasheet forms I find that it automatically saves column positions and widths without prompting to save changes. I should mention i am using Access 2000
12
5789
by: JHNielson | last post by:
This is king of urgent. I am in the middle of system testing and having problems. I have a form where users can update a Mater List of Values. I have a Save, Delete, Add-New, and Forward and Backward buttons. But when the users make changes to a record and then hit forward or hit "Add-New', it automatically saves the records. I thought about putting in an 'undo' command with the forward and backward buttons, but that undoes even changes...
27
6887
by: RobG | last post by:
I was investigating a function to determine whether daylight saving was being observed on a particular date (given the platform's regional settings) and came across a suggestion at merlyn.com to test the time zone offset on a variety of dates to see if it changes. Based on that, I developed the following checkDST() function which, as far as I can tell, should be sufficient. It checks either the date passed to it or the current date with...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.