On Wed, 27 Feb 2008 03:57:04 -0800 (PST), pyrahna wrote:
>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.
Hi pyrahna,
I only now see your own follow up message about the SET NOCOUNT. Yes,
omitting this command at the beginning of a trigger or stored procedure
results in extra results being sent to the client, which can cause all
kind of problems.
>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.
The ideal method would be to replace the entire trigger with a single
set-based logic. However, the trigger code is too complicated and too
long for me to try this from here and in my spare time. So either you do
that yourself, or you take a shortcut and simply use a cursor to process
all rows in the "inserted" pseudo table one by one.
Note that a cursor in a trigger is NOT generally recommended since it
hurts performance, but each rule has its exceptions.
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog:
http://sqlblog.com/blogs/hugo_kornelis