@@ERROR per connection?

  • Thread starter Thread starter Jeff User
  • Start date Start date
J

Jeff User

Hi
Hoping someone may know this. I am connecting to sql server 2K via
OleDbConnection from C#, .net1.1
Is the instance of @@ERROR that is set in db per connection? What I
was going to do was, after connecting and opening a data reader on one
connection, I wanted to open a 2nd connection and read @@ERROR.
But every time I read @@ERROR, it is 0, regardlessof the previous
read.
I suspect this is because conenction 2 is not reading the @@ERROR set
by connection1.
Is this the case?
Thanks
Jeff
 
Yes. @@ERROR is a matter of scope. Those two
connections do not share the same scope.
 
Back
Top