TooManyRowsAffectedException with encrypted triggers

Posted by Jon Masters on Stack Overflow See other posts from Stack Overflow or by Jon Masters
Published on 2009-08-30T17:17:54Z Indexed on 2010/04/23 11:53 UTC
Read the original article Hit count: 352

Filed under:
|
|

I'm using nHibernate to update 2 columns in a table that has 3 encrypted triggers on it. The triggers are not owned by me and I can not make changes to them, so unfortunately I can't SET NOCOUNT ON inside of them.

Is there another way to get around the TooManyRowsAffectedException that is thrown on commit?

Update 1

So far only way I've gotten around the issue is to step around the .Save routine with

var query = session.CreateSQLQuery("update Orders set Notes = :Notes, Status = :Status where OrderId = :Order");
query.SetString("Notes", orderHeader.Notes);
query.SetString("Status", orderHeader.OrderStatus);
query.SetInt32("Order", orderHeader.OrderHeaderId);
query.ExecuteUpdate();

It feels dirty and is not easily to extend, but it doesn't crater.

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about sql-server