Advertisement

rherguth Login Name
Limited Member Account Type
174,577 Expert Points
02/28/2003 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.
220 Questions Answered
Date Points Title Activity Type Zone
1 10/27/2006 500 Connect to server through stored proc… Accepted Databases
2 07/22/2006 500 ActiveX, Javascript, and unsafe C#… Accepted Web Development
3 06/02/2006 150 Noobie SQL INNER JOIN question Accepted Databases
4 05/09/2006 500 SQL PORT 1433 Accepted Databases
5 05/08/2006 125 NNTP Accepted Databases
 
153 Questions Participated In
754 Comments Posted
Date Points Title Activity Type Status Zone
1 01/10/2007 0 php_mysqli.dll not found, but it's t… Comment PAQ PHP installation
2 09/11/2006 0 Cause of FoxPro DB errors? Comment Deleted Databases
3 08/15/2006 250 WHERE DOES SQL SERVER 2000 L… Comment PAQ Databases
4 05/06/2006 500 Data modelers Comment PAQ Databases
5 04/17/2006 300 Multiple select for IF condition Comment PAQ Databases
 
27 Questions Asked
0 Questions Open
18 Questions Graded
9 Questions Deleted
Date Points Title Status Zone
1 01/11/2007 0 15 Jan - Please PAQ and Refund #a182… PAQ General Communit…
2 01/07/2007 0 php_mysqli.dll not found, but it's there! PAQ PHP installation
3 02/23/2006 0 Please Delete Q_21749511 PAQ General Communit…
4 02/23/2006 0 OLE STGMEDIUM Returns an HGLOBAL, but h… Deleted C#
5 11/22/2005 500 IDataObject cast problem with .NET 2.0 PAQ C#