Re: TRIGGER NEEDED SHOWING CREDIT CARD AUTH



Hugo - Don't rightly know if a view would work for us because each table is
in its own, separate database and instance of SQL Server. Also, writing a "Y"
to the CC_Authorized field would allow us to program the shipping app to then
mark the record for end-of-day processing in the shipping_queue table if we
decide to automate the process. Of course, a view could possibly work OK as a
reporting source if we intend to manually ID and mark approved credit card
shipments.

"Hugo Kornelis" wrote:

On Fri, 18 Sep 2009 05:28:01 -0700, meangene wrote:

I have two tables: InvoiceHeader and ShipmentHold. Both tables have a key
field OrderNumber that link them. I need an example of a trigger that would
do the following: IF InvoiceHeader.CC_AuthorizationNo is not null THEN write
value "Y" to ShipmentHold.CC_Authorized WHERE InvoiceHeader.OrderNumber =
ShipmentHold.OrderNumber.

What this trigger would do is write "Y" to the credit card authorized field
in the ShipmentHold table for the corresponding order that was just invoiced
with it's credit card payment approved. This allows our shiping folks to run
a periodic report showing what credit card shipments have been processed and
authorized and move those physically onboard the trailer.

Hi meangene,

Why not create a view instead of storing this redundant information in a
seperate table and using a trigger to maintain it (with still the risk
that there will be inconsistencies after all)?

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis

.



Relevant Pages

  • Re: TRIGGER NEEDED SHOWING CREDIT CARD AUTH
    ... field OrderNumber that link them. ... What this trigger would do is write "Y" to the credit card authorized field ... My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis ...
    (microsoft.public.sqlserver.programming)
  • Re: before delete triggers in MSSQL
    ... I have to agree 100% with Hugo. ... You can have as many actions in the trigger as you ... Pro SQL Server 2000 Database Design - ... >>out due to violated constraint checking. ...
    (microsoft.public.sqlserver.programming)
  • Re: Select Expression Operators
    ... Thanks Hugo. ... >>Sorry for what must seem like a dumb question, but I was wondering why I keep ... > SQL Server doesn't offer the same set of functions as Access and it ... > ISNULL will return the second expression if the first is NULL. ...
    (microsoft.public.sqlserver.mseq)
  • Re: Views
    ... Yes, Hugo, your description is perfect. ... SQL Server sometimes decides to materialize the view ... complicated queries, ... then you appear to have run into a bug. ...
    (microsoft.public.sqlserver.clients)
  • Re: Keeping User From Deleting Table Records
    ... Hugo - Thanks and will take a look at that but may be a day or two - I'm ... - I have created a new Windows user login in Security/Logins that is ... - I login to the network as domain/user and create an odbc system dsn entry ... SQL Server to obtain default settings for the additional configuration ...
    (microsoft.public.sqlserver.security)

Loading