Hey guys...I have this question which I was unable to solve.
Lets assume we Have 2 tables:
Account (AccountNum(PK), AccountName, Debit, Credit, Balance(diff between Debit and Credit)) TransactionHistory(TransactioID(PK), AccountNum(FK),TransAmount, TransType(Debit or Credit), TimeofTrans)
Now, the task is to design a SP along with trigger that will depict the banking transaction (SP will take 3 parameters: Account No, Transaction Type and Amount.
We have to make sure to check the balance in the Account before proceeding in case of Debit. When a transaction is done fire a trigger that put corresponding records in transaction history table both in case of Credit and Debit. Also we have to ensure that SP will run in any situation and will throw exception that is understood by Non-Technical Users.).