Re: Error Handling Coming Out of a Trigger



I like to keep the logic in the Dephi app when it is complicated. I have
seen SQL Servers brought to their knees or cluged up unnecessarily
spreading
DB's across multiple servers because the logic in SP and Triggers was
overly
complex.

I am moving the trigger's logic into the stored procedures. A discussion got
me no where, as far as getting the application to handle the logic.


The example you have right now with your "service lines" is a good one.
There are multiple ways to handle it probably and changing approaches in
stored procedures is usually more difficult than changing program code.
....
IMHO.

It's definitely easier than doing it in the trigger where your limited to
only field values. At least with procs i have parameters too.


Can you give me a little more detail about service lines and discounts on
transactions?


Our transaction encompasses:
The Account the Service Lines were provided to
Insurance Policy Information
Incident Records
Special Forms attached, CMNS, Auth forms, and more...

The Service Line
Is a service/item provided to the account on the transaction
Contains Fees
Discount percentage
Taxable status
Service dates
HCPC, Modifiers, and other medical codes


Each service line:
May/May not be taxed
May/May not be discounted
May/May not have a different tax rate from the same tax schedule (Some
states have Use Tax and Medical Necessity Tax rates for
different items provided.)
Should always have a qty of one or more
Fees cannot be less than zero
Must have a starting service date



I see what you mean by the flexibility the front-end has. Your example
clearly points it out. But I'm bound by title to provide this functionality
in the stored procedure. They do not want to recompile the application to
make a change like this. If i can prove that performance is hindered than of
course we will seek out another avenue. Besides at this point, there is not
much mroe complexity than i have provided here.


THis really isnt rocket science you know ... :-)

Isn't it close sometimes....


Thanks,


--
Got a big event coming up? Let us
help coordinate your event. For more
visit www.kissemgoodbye.com


.



Relevant Pages

  • Re: Transaction Oriented Architecture (TOA)
    ... It had better be a transaction I already know about so I can record it properly and make sure your session gets credit. ... In that case the client-side Data Layer has the responsibility for mundane tasks like forming SQL queries and encoding/decoding SQL datasets. ... What I am talking about is analogous to that layer that decouples the Business Layer through an interface so the Business objects don't have to know about the specific mechanisms. ... TOA/TOP proposes the database and its application domain stored procedures are the only persistence mechanism necessary, and that the benefits of a focused, single, data-permeable gateway between application and database far exceed the benefits of O/R mappings--regardless of abstraction--and that its lightweight appearance shouldn't be dismissed as missing heavyweight kick. ...
    (comp.object)
  • Re: multiple SP within transaction
    ... A transaction can span multiple batches, and multiple stored procedures. ... Wayne Snyder, MCDBA, SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: multiple SP within transaction
    ... >A transaction can span multiple batches, and multiple stored procedures. ... > Wayne Snyder, MCDBA, SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • ADO.net or TSQL Transactions
    ... Should implement a transaction in both the stored procedure AND in ADO.net ... code or is doing it in one or the other good enough to protect against ... >>stored procedures, and the stored procedures are themselve quite quite ... >>protected from this by virtue of the ADO transaction object. ...
    (microsoft.public.sqlserver.programming)
  • A question of Transactions
    ... if I use and ADO transaction object to execute say 10 ... stored procedures, and the stored procedures are themselve quite quite long ...
    (microsoft.public.dotnet.framework.adonet)