I created my first database app on an Atari 800XL using forward and backward link lists. I quickly ran out of RAM programming in Atari BASIC in 64k, so I started using 6502 Assembler code to do do more with less. Although, I don't do assembly programming any more, I often still need to do more with less on Windows and love pushing the envelope and trying things that often fail at first. I love to know how and why something works and use that knowledge to make applications more maintainable.
I'm currently a MS SQL Server and Sybase consultant. Formerly, I worked on internet time to architect, and help develop a nationally marketed enterprise CRM/Service Delivery system for government human service organizations.
I tend to like to address questions that haven't received any responses from experts after a period of time. Unfortunately, there doesn't appear to be an easy way to find those in EE, so e-mail me with a link to your Q if it fits in that category.
devxchange(AT)hotpursuit.n
et
Rules for MS SQL/Sybase Trigger Creation:
1) Assume that there will be multiple rows in the inserted and deleted tables. And design your code around it.
2) Avoid creating a trigger if it's not absolutely necessary.
a) Avoid using triggers if the same effect can be achieved through Referential Integrity Constraints.
b) If a trigger must be used, bracket the statements with IF UPDATE() or IF EXISTS code so unecessary code doesn't execute
3) Always remember that a trigger can cause other triggers to fire and nesting will begin unless you've disabled that option in the DB.
3a) I recommend adding debugging code to all of your triggers to help diagnose problems with nesting. It can become quickly mind-boggling.
DECLARE @Debug Int
SET @Debug = 0
IF @Debug = 1
RAISERROR ('tU_UserSubscription.Paid
InFull: Updating Start and End Dates in UserSubscription', 16, 1)
4) Always set NOCOUNT ON to avoid confusing ADO with "n records affected" messages (thanks auke_t)
5) Do use triggers if you've considered these issues and updates may be made to the database through more than one application.