473,378 Members | 1,543 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How do I create a trigger that will insert only changes to a field?

I have a table with 6 fields that keep getting erased, so I need to create a trigger that will automatically insert into a backup table any new inserts inot table 1 and update with any updates to table 1 but will not delete from table 2 if there are any deletes in table 1. Any help would be appreciated.
Mar 23 '11 #1
1 1552
ck9663
2,878 Expert 2GB
I am a little unclear of what you are trying to do. Here is a primer for triggers.

Good Luck!!!

~~ CK
Mar 23 '11 #2

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

Similar topics

1
by: Darren | last post by:
Hello, I have some 'CREATE TRIGGER' definitions that work when cut/pasted into SQL*Plus worksheet and execute separately but fail with a 'trigger created with compilation errors' when executed...
1
by: Lisa Tang | last post by:
Hi, I have a table t1 with a long raw column, and I need to create a view v1 with a long raw column being a function ff1 of the long raw column in t1. And I need to update t1 with reverse...
1
by: Jack | last post by:
I created a trigger in the "source table" that will "feed" and second table. The trigger is as follows: CREATE TRIGGER ON dbo.FromUPS FOR INSERT AS Declare @Count int Select @Count =...
1
by: vios | last post by:
Hi, I have created a trigger as below to update a table called vnd_trail to show what sort of operation(update/delete) happened to the name column. My problem is, I want to have another column to...
8
by: FM | last post by:
Hello: I want to create a trigger wich performs a write-action to a text file. I'm intending to create it with: CREATE TRIGGER TR_ALARMA_TSPRE AFTER INSERT ON T_ALARMA_TS FOR EACH STATEMENT...
2
by: fatjoez | last post by:
Hi there. I'm trying to create a Trigger for on insert, which will be triggered upon any attempted insert into a database table item. Basically want it to say, if the attempted insert value for...
1
by: veasnamuch | last post by:
I have a problem while I create a trigger to my table. My objective is getting any change made to my table and record it in to another table . My have thousands records before I add new trigger to...
5
by: mse07 | last post by:
hi i need to create trigger when insert records in table for example when insert records in table then run exe program. or if any records insert in table i need alert that is record...
2
by: Yas | last post by:
Hello All, I have 2 tables in a MS SQL DB. Table1 and Table2.Log Table2.Log was a copy of Table1 + an extra column for date_deleted. I have 2 Triggers on Table1, Insert and delete. So when a...
3
by: Andrea MF | last post by:
Hi all, i have a problem when creating a trigger on DB2 ver 7.2 on WINDOWS. I have two tables MOVIMAG and BARCODE, the trigge when INSERT INTO MOVIMAG will be UPDATE a MOVIMAG field BARCODE...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.