473,618 Members | 3,170 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

some of my data is getting overwritten by the update query i want to save my old data

1 New Member
Some of my data is getting overwritten by the update query.
I want to save my old data.

So how can i save my old data?
Sep 9 '10 #1
1 1390
magicwand
41 New Member
write a BEFORE UPDATE trigger that copies the old value(s) into a history table with identical structure (plus update - date)
Sep 12 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5796
by: Alex | last post by:
Hello, I have a rather large table in MS SQL 2000 that I'm writing reports in Crystal from, but I'm unsure how to get the various data files (from different departments) into the table. Below is a small chunk of the table: DeptCode;Type;AveMonthVolume;WorkedFTE;TotHours;Benefits I'm getting data from multiple places, but as I import the data, I
4
19734
by: | last post by:
I'm a bit of a newby to creating update queries so I was hoping those more experienced could help with what should be a simple query. I do know to create backups and test on a test database first. I need to copy an items' cost from location 'CA' to the cost in location 'OH' when the cost in 'CA' is not zero Table name is ITEMS Location column is LOC Cost column is COST
1
11108
by: avinash | last post by:
hi myself avi i am developing one appliacaion in which i am using vb 6 as front end, adodb as database library and sql sever 7 as backend. i want to update one table for which i required data from other table. and iretrive data from second table by giving some condition. when i get data, then to update first table i need to use do while loop. instead of that i want to use select statement directly in update query. plz give me some help....
4
4147
by: rdraider | last post by:
I am looking for some assistance with an update query that needs to link 3 tables: This query ran and reported over 230,000 records affected but did not change the field I wanted changed, not sure what it did. I did notice that the "name" in "GM_NAMES.name" was colored blue in Query Analyzer. Is it bad to name a column "name"? UPDATE ABSENCES set CustomerContactID = cicntp.cnt_id
1
5173
by: Kunal | last post by:
Hi, I need some help on writing an update query to update "UnitsSold" field in Products Table whenever I save a transaction. The transaction may contain several "Subtransactions", one for each product sold in that transaction. I have a subtransaction table that maintains record of each subtransaction, with data such as: ProductID, Quantity, TransactionID etc. The Products table has fields: ProductID, UnitsSold, UnitsOrdered,...
4
3175
by: holmm | last post by:
Hi, First post so apologies if this sounds a bit confusing!! I'm trying to run the following update. On a weekly basis i want to insert all the active users ids from a users table into a timesheets table along with the last day of the week and a submitted flag set to 0. I plan then on creating a schduled job so the script runs weekly. The 3 queries i plan to use are below.
2
4555
by: Neville MADDEN | last post by:
Good morning everyone, I'm producing an A97 database of Mining records. One of the tables has the map sheet references as SH/55-14. The other table has the references as SH55-17. I want to add the "/" to the data in table2 (or take it out of Table 1). I have tried all sorts of update criteria such as "*""*"*&"/"&"*""*" and variations on this but none of them want to work. There are 12,000+ records in the db so to do it manually would...
1
978
by: Davidsm | last post by:
Hi guys i am using a update query to replace data in a column in a table the column name is MO_EA and Measure. If MO_EA is Bond Alliance or Bond Alliance CT in need to update the Column MEASURE to be Bond Alliance I am using the below code but its not changing the Bond Alliance CT to Bond Alliance but is change Bond alliance correctly not sure where i am going wrong UPDATE SET Measure = mo_ea WHERE mo_ea="Bond Alliance" Or mo_ea Like...
2
1698
zachster17
by: zachster17 | last post by:
Hello everyone, I'm having difficult getting an update query to work. What I'm doing is search a table with filenames against another table that has filename wildcards that search against the filenames--if a match is found then it updates the status of the files. Code is below; let me know if I can clarify anything for you. Thanks, Zach
33
2653
by: mjvm | last post by:
HI, I have a main table (tblStudents) that holds students where the unique field is StudentID; and a related table (tblNotes) on a one-to-many relationship, where the unique field is NotesID, and the linked field (relationship) is with NotesStudentID. That is one student can have many notes. I run a query where we isolate a number of students (qryChase). What I would like to be able to do is then run an update query using the dataset...
0
8207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8150
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8303
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
8453
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
7124
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...
0
5552
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4064
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
4147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.