You are here: Re: Using a trigger to generate an ID value « MsSQL Server « IT news, forums, messages
Re: Using a trigger to generate an ID value

Posted by Erland Sommarskog on 09/22/06 07:20

imani_technology_spam@yahoo.com (imani_technology_spam@yahoo.com) writes:
> Speaking of testing, what would happen if I inserted a bunch of rows
> into the table that already have LabID's? Would that cause a problem
> with the trigger? I'm thinking about future data migration.

The trigger does not take that in regard, because that was not in the
requirement specification. But you could use the coalesce function to
handle this. coalesce takes a list of values as input parameters, and
returns the first non-NULL value in the list.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

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

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