@@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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top