Discussion Locked

Avoid output message when using Trigger

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I created a trigger for delete on my table. When a user try to delete an item, several processes are lunched, and I don't want this processes to output. When the user try to delete a row, he got a result like

(1 row(s) affected)

(2 row(s) affected)

(0 row(s) affected)

Is it a way to silent the output? something like set output_message off [...] set output_message on
?

Thank you

4 replies

by werewolf_

Thanks for your post. My example was not a good one, so let's try with something else. When a user try to delete a certain row, I set the identity to off, then recreate the record from the deleted table, reseed the pk, and reset the identity on. I got this message:

Checking identity information: current identity value '24', current column value '23'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

It's that, more than the number of fields modified, who bug me.

Thank you again

by werewolf_

dbcc checkident('',reseed,23)WITH NO_INFOMSGS

This sentence gives me the result I need. I still think that there's another way to avoid the output globally, but at least it's work now.

Thank you for help, appreciated.

This discussion is closed to new replies.