You are here: Re: Mass Update on Table with Trigger « MsSQL Server « IT news, forums, messages
Re: Mass Update on Table with Trigger

Posted by Erland Sommarskog on 06/29/07 21:29

(paulmac106@gmail.com) writes:
> I need to update a field in about 20 records on a table. The table has
> an update trigger (which updates the [lastedited] field whenever a
> record is updated). As a result I'm getting an error: "Subquery
> returned more than 1 value.", and the update fails.
>
> Is there a way in the stored procedure to handle this issue?

If you are not able to correct the trigger, you will have to run a
cursor to updaet one row at a time. But obviously that should be a very
last resort.


--
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

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