Showing posts with label ado. Show all posts
Showing posts with label ado. Show all posts

Wednesday, March 7, 2012

How to set default SQL Timeout

I have an app that uses ADO connections, and when I run a particular
operation I get a SQL Timeout, but when I run the same operation with the
same executable on another client I don't get a timeout. A Profiler trace
confirms that the first query times out after 30 seconds (the default), and
the second client succeeds after about 40 seconds. Both clients are running
the same MDAC version.
I thought that the query timeout is set in the ADO command object, but this
behavior leads me to think otherwise. Is there a way to set the default
timeout value on a client?
Thanks,
Tom
Well, I've partially explained my own problem. The client that isn't timing
out is running on the server using the shared memory protocol LPC. When I
disable that and force the connection to use TCP/IP or named pipes, then I
get the SQL Timeout. So now my question is why is there a different timeout
value for TCP/IP and named pipe connections than there is for shared memory
connections?
Tom
"Tom" wrote:

> I have an app that uses ADO connections, and when I run a particular
> operation I get a SQL Timeout, but when I run the same operation with the
> same executable on another client I don't get a timeout. A Profiler trace
> confirms that the first query times out after 30 seconds (the default), and
> the second client succeeds after about 40 seconds. Both clients are running
> the same MDAC version.
> I thought that the query timeout is set in the ADO command object, but this
> behavior leads me to think otherwise. Is there a way to set the default
> timeout value on a client?
> Thanks,
> Tom

How to set default SQL Timeout

I have an app that uses ADO connections, and when I run a particular
operation I get a SQL Timeout, but when I run the same operation with the
same executable on another client I don't get a timeout. A Profiler trace
confirms that the first query times out after 30 seconds (the default), and
the second client succeeds after about 40 seconds. Both clients are running
the same MDAC version.
I thought that the query timeout is set in the ADO command object, but this
behavior leads me to think otherwise. Is there a way to set the default
timeout value on a client?
Thanks,
TomWell, I've partially explained my own problem. The client that isn't timing
out is running on the server using the shared memory protocol LPC. When I
disable that and force the connection to use TCP/IP or named pipes, then I
get the SQL Timeout. So now my question is why is there a different timeout
value for TCP/IP and named pipe connections than there is for shared memory
connections?
Tom
"Tom" wrote:

> I have an app that uses ADO connections, and when I run a particular
> operation I get a SQL Timeout, but when I run the same operation with the
> same executable on another client I don't get a timeout. A Profiler trace
> confirms that the first query times out after 30 seconds (the default), an
d
> the second client succeeds after about 40 seconds. Both clients are runni
ng
> the same MDAC version.
> I thought that the query timeout is set in the ADO command object, but thi
s
> behavior leads me to think otherwise. Is there a way to set the default
> timeout value on a client?
> Thanks,
> Tom

How to set default SQL Timeout

I have an app that uses ADO connections, and when I run a particular
operation I get a SQL Timeout, but when I run the same operation with the
same executable on another client I don't get a timeout. A Profiler trace
confirms that the first query times out after 30 seconds (the default), and
the second client succeeds after about 40 seconds. Both clients are running
the same MDAC version.
I thought that the query timeout is set in the ADO command object, but this
behavior leads me to think otherwise. Is there a way to set the default
timeout value on a client?
Thanks,
TomWell, I've partially explained my own problem. The client that isn't timing
out is running on the server using the shared memory protocol LPC. When I
disable that and force the connection to use TCP/IP or named pipes, then I
get the SQL Timeout. So now my question is why is there a different timeout
value for TCP/IP and named pipe connections than there is for shared memory
connections?
Tom
"Tom" wrote:
> I have an app that uses ADO connections, and when I run a particular
> operation I get a SQL Timeout, but when I run the same operation with the
> same executable on another client I don't get a timeout. A Profiler trace
> confirms that the first query times out after 30 seconds (the default), and
> the second client succeeds after about 40 seconds. Both clients are running
> the same MDAC version.
> I thought that the query timeout is set in the ADO command object, but this
> behavior leads me to think otherwise. Is there a way to set the default
> timeout value on a client?
> Thanks,
> Tom

Friday, February 24, 2012

How to set Client Machine name when using ADO to connect to SQL Server 2000?

When you connect to SQL Server using SQLConnection, how to set client machine name(or IP address) so that you can monitor the process on Server side using Enterprise Manager?


Whatever IP address you provided in the connection string can be used to monitor along with the user id of sql in case mixed mode authentication is there.

Please post more details..

Satya

|||

In your connection string, you can add a name/value pair like

workstation id=MYCOMPUTERNAME

and now when you runsp_who you will see MYCOMPUTERNAME for the value in thehostname column.

You can also set a value for you application like

Application Name=Your Application

within your connection string.