Send Connection Instructions to SQL Server

  • Thread starter Thread starter Eric Sabine
  • Start date Start date
E

Eric Sabine

I assume that I can send the statement 'SET ANSI WARNINGS OFF' to SQL with
the sqlcommand object's method ExecuteNonQuery(), but can it (and other
behavioral statements) be sent alternatively?

Reason I ask is I'm executing stored procedures and simply didn't want to
pass behavioral statements this way. Is there any property like
_cmdSqlServer.Behavior = ...

thanks,
Eric
 
Each of the SET options changes the state of the current connection. When
the connection is closed or reset these state values are reset to the state
determined by the SA when the DB is installed. This means that if you open
and maintain the connection, you can submit a normal ExecuteNonQuery to
change the state as needed. This SET can be added to the SP in question as
well.

hth

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top