Search code examples
sql-servernhibernatesql-server-2000

Set NOCOUNT OFF at database level?


Can I set NOCOUNT to be OFF by default for a particular database?

I need it for NHibernate (if it's ON, I get exceptions when saving). I can see the setting to disable it for an entire server (where it's set ON), but we're sharing the server with other databases. Is there a way I can set it to OFF just for my database?

Or is there an NHibernate setting that will do this for me? (I've worked around it for now with a custom DriverConnectionProvider that issues the command whenever it creates a connection. Works ok, but feels a bit awkward)

I'm using SQL Server 2000, btw.

Thanks Matt


Solution

  • no, there is no database wide setting for SET NOCOUNT.

    same question: http://www.eggheadcafe.com/software/aspnet/32120672/set-nocount.aspx