rherguth Login Name
Limited Member Account Type
176,077 Expert Points
02/28/03 Registration Date
0 Points this month
Expert Certifications:
rherguth has earned the following certifications.
Member Profile:
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.net

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.PaidInFull: 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.
 
156 Questions Participated In
761 Comments Posted
Date Points Title Activity Type Status Zone
07/25/09 500 Use Javascript in a C++ app t… Comment Deleted JavaScript
06/10/09 0 IE 7.0 problem: Getting iFra… Comment Deleted Web Development
01/24/09 50 I have verified Netstat also, b… Comment Deleted Databases
01/10/07 0 php_mysqli.dll not found, b… Comment PAQ PHP installation
09/11/06 0 Cause of FoxPro DB errors? Comment Deleted Databases
 
27 Questions Asked
0 Questions Open
18 Questions Graded
9 Questions Deleted
 
0 Articles Written
0 Article Comments