Saturday, February 25, 2012
Connection Timeout
a user stays connected to mssql server? I have an
application that logs into mssql server and then uses
that one login for all work never logging out, after
about 7 days(fairly consistently) the connection to the
mssql gets killed and the application has to be
restarted. I was just curious if there is some kind of
parameter within mssql server that kills logins after x
number of days?
Thanks,
CarlHi,
There is no parameter in SQL server which will kill the user after x number
of days.
Rather you can write ur own code based on the login_time in
master..sysprocesses table and compare with getdate() for each process id
available in the list.
If any of the SPID is older then x days you can use
KILL SPID to kill the user. SPID also you can take it from
master..sysprocesses tables
Thanks
Hari
MCDBA
"z-man" <anonymous@.discussions.microsoft.com> wrote in message
news:817d01c4076d$e655aa20$a601280a@.phx.gbl...
> Is there any configuration option that controls how long
> a user stays connected to mssql server? I have an
> application that logs into mssql server and then uses
> that one login for all work never logging out, after
> about 7 days(fairly consistently) the connection to the
> mssql gets killed and the application has to be
> restarted. I was just curious if there is some kind of
> parameter within mssql server that kills logins after x
> number of days?
> Thanks,
> Carl
>|||There isn't anything like that built into SQL Server. You
could write your own procedure to do something like that but
nothing built into SQL Server.
If the application is on PC, server other than SQL Server,
you may want to look into network connectivity issues. You
may want to check the event logs where the application is
and see if you can find any clues in the logs.
-Sue
On Thu, 11 Mar 2004 05:36:47 -0800, "z-man"
<anonymous@.discussions.microsoft.com> wrote:
>Is there any configuration option that controls how long
>a user stays connected to mssql server? I have an
>application that logs into mssql server and then uses
>that one login for all work never logging out, after
>about 7 days(fairly consistently) the connection to the
>mssql gets killed and the application has to be
>restarted. I was just curious if there is some kind of
>parameter within mssql server that kills logins after x
>number of days?
>Thanks,
>Carl|||There is a 2 hour tcp session timeout and 1 hour for name pipe sessions.
But, this is controlled by the OS, not SQL.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||That's a good point...and looking at the keepalive settings
could be an option. After thinking about it more and that if
this happens about every 7 days, it may more likely be
related to a weekly process or something similar that is
hosing the connection. I think I'd go through the logs and
look for activity around the time the connection gets hosed.
-Sue
On Thu, 11 Mar 2004 21:02:41 GMT, kevmc@.online.microsoft.com
(Kevin McDonnell [MSFT]) wrote:
>There is a 2 hour tcp session timeout and 1 hour for name pipe sessions.
>But, this is controlled by the OS, not SQL.
>Thanks,
>Kevin McDonnell
>Microsoft Corporation
>This posting is provided AS IS with no warranties, and confers no rights.
>
Friday, February 10, 2012
connection problem to sql 2000 on windows 2003 from Windows 95
I have a Windows 2003 server, which is also a terminal server for
application, with sql 2000 installed. My company has developed an
application that uses SQL 2000 as its database. The application is a
client/server one. In each client computer there's a link to the
application on the server. There is no problem with Windows 98,
Windows 2000 pro, Windows xp pro clients, but the windows 95 ones
cannot log in to the database. The log of the application shows the
following error:
connection error -2147467259. Cannot open database requested in login
'database name'. Login fails.
Till a week ago the application was running on a Windows 2000 server
with SQL 2000 install and the W95 clients had no problem connecting to
the database, so my guess is the error has something to do with
Windows 2003 server, but what'causing the error?
I tried to install a newer version of MDAC (MDAC 2.5, the last version
of MDAC you can install on W95)but with no success. By the way W95
clients have no problem accessing shared folder on the Windows 2003
server.
Any idea?
Thanks
Marino[posted and mailed, please reply in news]
Marino (mmagi@.itconsult.it) writes:
> I have a Windows 2003 server, which is also a terminal server for
> application, with sql 2000 installed. My company has developed an
> application that uses SQL 2000 as its database. The application is a
> client/server one. In each client computer there's a link to the
> application on the server. There is no problem with Windows 98,
> Windows 2000 pro, Windows xp pro clients, but the windows 95 ones
> cannot log in to the database. The log of the application shows the
> following error:
> connection error -2147467259. Cannot open database requested in login
> 'database name'. Login fails.
> Till a week ago the application was running on a Windows 2000 server
> with SQL 2000 install and the W95 clients had no problem connecting to
> the database, so my guess is the error has something to do with
> Windows 2003 server, but what'causing the error?
That particular error message means that the logins have a default
database that does not exist on the server, or which they have not
been granted access to.
Are the W95 clients using SQL authentication or Windows authentication?
I would assume that SQL authentication is the only thing that works.
Review how the Win95 clients access the server, and then do an
sp_helplogins on the logins they use. Then check DefDbName, whether
this database exists, or if they have been granted access. Use
sp_defaultdb to change their default db if necessary. (sp_defaultdb
may be called something else; use Books Online to find out.)
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp