You are here: Re: Working with Ints and Nulls « MsSQL Server « IT news, forums, messages
Re: Working with Ints and Nulls

Posted by --CELKO-- on 12/05/06 19:27

>> I have an instead of trigger for update on particular table which adds 3 or so columns and puts the total in a 4th <<

The quick, stinking dirty kludge is to use COALESCE() in your
computation.

The *right* answer is that good SQL programmers avoid triggers
(procedural code!! UGH!) and do not store redundant data in a table.
What you have re-discovered is the right-most column of a punch card in
a 1950's EDP system and mimiced it in SQL!! That is where we always
stored totals and the un-punched columns were read as a zero by the EAM
(google it!).

Your whole approach to SQL is totally wrong. Stop what you are doing
and get some minimal education. Look at using a VIEW that will always
be correct.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация