Re: Error on Trigger Launch
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Wed, 27 Feb 2008 22:35:40 +0000 (UTC)
pyrahna (pltaylor3@xxxxxxxxx) writes:
It was an error message from Microsoft SQL Server Managment Studio
front end....not technically a sql message but i would hope that it
would handle error messages decently.
The Open Table thing in Mgmt Studio is fairly crappy in my opinion. I never
use it myself.
As for the select statement that has been pointed out by two people
now I don't see it being a problem in the application, but I am
interested in possible solutions and work arounds so that the problem
doesn't exist and so Ii can better at this.
thank you for your time
You could set up a cursor that loops over inserted, if you think that
multi-row updates are rare.
Or you can be this brutal and add this first in the trigger:
IF @@rowcount > 1
BEGIN
ROLLBACK TRANSACTION
RAISERROR('Multi-row updates are not permitted on this table', 16, 1)
RETURN
END
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
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
.
- References:
- Error on Trigger Launch
- From: pyrahna
- Re: Error on Trigger Launch
- From: Hugo Kornelis
- Re: Error on Trigger Launch
- From: pyrahna
- Error on Trigger Launch
- Prev by Date: Re: Using a "match" table to store multiple columns for parent data
- Next by Date: Re: Problem with a lot of inserts in short time - SQL Server 2000
- Previous by thread: Re: Error on Trigger Launch
- Next by thread: Re: Error on Trigger Launch
- Index(es):
Relevant Pages
|