473,327 Members | 1,967 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,327 software developers and data experts.

SP or Trigger rule ??

I got two same tables (invoice, invoice_history)
When user insert the record, (i will save a copy in the table
invoice_history)
when user amend the record, (i iwll save the updated record in the table
invoice_history_too)
Now, I am worry that I don't know how to do that by trigger rule.
If is use SP to do, Will it make the system (vb.net) too slow,
I am newbie in trigger rule , and don't know how to design,
Can anyone be kind to give me some idea ? Thanks in advance.
Nov 21 '05 #1
2 960
Agnes wrote:
I got two same tables (invoice, invoice_history)
When user insert the record, (i will save a copy in the table
invoice_history)
when user amend the record, (i iwll save the updated record in the table
invoice_history_too)
Now, I am worry that I don't know how to do that by trigger rule.
If is use SP to do, Will it make the system (vb.net) too slow,
I am newbie in trigger rule , and don't know how to design,
Can anyone be kind to give me some idea ? Thanks in advance.


using a sproc will not slow down the system. In most cases a sproc will
speed things up.
Nov 21 '05 #2

Well a trigger is verry suitable for this purpose

here is a good article that covers the subject on how to use them in the by
you described situation http://www.developerfusion.co.uk/show/2413/1/

a trigger is not faster or slower as a SP ,, in a mather of fact i was
tought that in fact a trigger is a event driven proc , this is why they are
so handy they can be "triggered" at certain events that occur on your table
( inserting , deleting , modifying data )
regrds

Michel Posseth [MCP]

"Chris" <no@spam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Agnes wrote:
I got two same tables (invoice, invoice_history)
When user insert the record, (i will save a copy in the table
invoice_history)
when user amend the record, (i iwll save the updated record in the table
invoice_history_too)
Now, I am worry that I don't know how to do that by trigger rule.
If is use SP to do, Will it make the system (vb.net) too slow,
I am newbie in trigger rule , and don't know how to design,
Can anyone be kind to give me some idea ? Thanks in advance.


using a sproc will not slow down the system. In most cases a sproc will
speed things up.

Nov 21 '05 #3

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

Similar topics

8
by: Jason | last post by:
I have a table that matches up Securities and Exchanges. Individual securities can belong on multiple exchanges. One of the columns, named PrimaryExchangeFlag, indicates if a particular exchange is...
2
by: Jules Alberts | last post by:
Hello everyone, Several columns in sereval tables in my DB should always be lowercase. I now have a simple function: create or replace function code_lower() returns trigger as ' begin...
0
by: Uwe C. Schroeder | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi everybody, I have tables like create table xx ( id int4,
3
by: Barbara Lindsey | last post by:
I have a case where I am collecting a "Start Date" and an "End Date". I would like to default the "End Date" to the "Start Date" value if only the "Start Date" is entered. I tried setting this as...
1
by: Bastian Blank | last post by:
I'm using postgresql 7.4.2 and COPY FROM don't trigger INSERT rules. Definitions: | CREATE TABLE log.package_status ( | version integer NOT NULL, | architecture integer NOT NULL, | ...
4
by: Naeem Bari | last post by:
Hi, I am using postgres 7.4.5 on Redhat Enterprise Linux 3. My background is really on Oracle, and I am porting a largish database over to postgres. Here is my problem: On oracle, I...
2
by: Dima Gofman | last post by:
I have a trigger on UPDATE on a table. I'm running some maintenance UPDATE and DELETE queries which I want the trigger to ignore but at the same time I want other UPDATE queries that other users...
3
by: teddysnips | last post by:
I need a trigger (well, I don't *need* one, but it would be optimal!) but I can't get it to work because it references ntext fields. Is there any alternative? I could write it in laborious code...
1
by: DennBen | last post by:
I am doing an update to set a field value = anothe field value (in the same table) where it is not supplied. I'm handling this in the trigger, but am getting deadlocks. Do you see anything...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.