Tuesday, March 20, 2012
connections to SQL Server
I need to put a script together that would tell me how many connections to SQL Server there are at any given time. Which table would store this info?
Thanks.Define what you mean by connections, and which version of SQL Server you are targeting. One simplistic answer for SQL 2000 would be:SELECT Count(DISTINCT spid)
FROM master.dbo.sysprocesses
WHERE 50 < spid-PatP|||The information from the sp_who/sp_who2 stored procedures might also be useful...
Monday, March 19, 2012
Connections
number of connectionsMarcelo (Marce.Fernandezi@.gmail.com) writes:
Quote:
Originally Posted by
Hi I would like to know about connections of sa, where SQL store the
number of connections
The number of connections of sa? I'm not sure that I understand the
question.
Current conections are, as far as I know, not stored anywhere else than
in main memory. If SQL Server dies, then the connections are broken, and
all information about them are lost.
If this was not what you were asking for, maybe you could clarify?
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
ConnectionRead (InvalidParam()) error
L
Query Analyzer. After a few more attempts, the query succeeds... How can I
troubleshoot this network error...
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (Inv
alidParam()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection BrokeFirst thing to check, just like the message stated, "General network error.
Check your network documentation." The fact that it sometimes works and
sometimes not points to an unstable network.
hth
Quentin
"Shaila" <Shailaja @.discussions.microsoft.com> wrote in message
news:03329249-66CC-4806-91A9-D5434C3130D9@.microsoft.com...
>I get the following error sometimes when I execute a store procedure from
>SQL
> Query Analyzer. After a few more attempts, the query succeeds... How can I
> troubleshoot this network error...
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead
> (InvalidParam()).
> Server: Msg 11, Level 16, State 1, Line 0
> General network error. Check your network documentation.
> Connection Broke
ConnectionRead (InvalidParam()) error
store procedure. After a few attempts the query succeeds but how can i
resolve this issue...
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (InvalidParam()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection BrokeHi,
This is due to the network that you are having. Due to network congestion u
might be facing this problem. Try to enhance the network and try again
"Shaila" wrote:
> Somtimes I get the following error in SQL query Analyzer when executing a
> store procedure. After a few attempts the query succeeds but how can i
> resolve this issue...
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (InvalidParam()).
> Server: Msg 11, Level 16, State 1, Line 0
> General network error. Check your network documentation.
> Connection Broke
ConnectionRead (InvalidParam()) error
Query Analyzer. After a few more attempts, the query succeeds... How can I
troubleshoot this network error...
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (InvalidParam()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection BrokeFirst thing to check, just like the message stated, "General network error.
Check your network documentation." The fact that it sometimes works and
sometimes not points to an unstable network.
hth
Quentin
"Shaila" <Shailaja @.discussions.microsoft.com> wrote in message
news:03329249-66CC-4806-91A9-D5434C3130D9@.microsoft.com...
>I get the following error sometimes when I execute a store procedure from
>SQL
> Query Analyzer. After a few more attempts, the query succeeds... How can I
> troubleshoot this network error...
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead
> (InvalidParam()).
> Server: Msg 11, Level 16, State 1, Line 0
> General network error. Check your network documentation.
> Connection Broke
ConnectionRead (InvalidParam()) error
Query Analyzer. After a few more attempts, the query succeeds... How can I
troubleshoot this network error...
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (InvalidParam()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection Broke
First thing to check, just like the message stated, "General network error.
Check your network documentation." The fact that it sometimes works and
sometimes not points to an unstable network.
hth
Quentin
"Shaila" <Shailaja @.discussions.microsoft.com> wrote in message
news:03329249-66CC-4806-91A9-D5434C3130D9@.microsoft.com...
>I get the following error sometimes when I execute a store procedure from
>SQL
> Query Analyzer. After a few more attempts, the query succeeds... How can I
> troubleshoot this network error...
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead
> (InvalidParam()).
> Server: Msg 11, Level 16, State 1, Line 0
> General network error. Check your network documentation.
> Connection Broke
Friday, February 24, 2012
Connection string not valid !
I've build a website with asp.net and on my local machine it run very we. but when I store my website on a server, I have a error : ...error: 25 - Connection String not valid...
This is my connection string on my local machine : "add name="csIyp" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|iyapason.mdf;User Instance=true" providerName="System.Data.SqlClient" "
And the connection string on my webserver : "add name="csIyp" connectionString="data source= .\MSSQLSERVER;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|iyapason.mdf;User Instance=true" providerName="System.Data.SqlClient" "
So, what can I do to solve this probleme.
Thanks !
Does your web server have an actual SQL Server Express database engine installed, or SQL Server 2005 of some kind (as in, not Express). If the later, attaching DB on the fly like that string does might not work.|||There is a SQL Server 2005 engine installed on my webserver and i think that the instance name is "MSSQLSERVER". so can I have a sample connection string?|||Hi siebobby,
Base on my understanding, we will not install SQL Server Express on the web server. So I think MSSQLSERVER is not an Express Edition. If my supposition is incorrect, please feel free to point out.
AttachDBFilename is used to specify the database to attach to the user instance. And User instances only work in the Express Edition of SQL Server 2005. So you must change the connect string for new SQL Server, the string may likes below:
connectionString="Data Source=.\MSSQLSERVER;Initial Catalog=iyapason;Integrated Security=True"
Be sure attaching iyapason.mdf in the MSSQLSERVER first.
Sunday, February 19, 2012
Connection String for SQL 2005 Express
My C# app uses SQL Server 2005 Express edition.
I store my connection string in a config file.
My application will run on numerous machines and therefore the machine name
will be different each time. What I would like is a generic connection strin
g
so that I don't have to change it each time I install my app on a different
machine.
I therefore want to avoid specifing the machine name in the connection
string as shown below :-
"Data Source=MachineName;Initial Catalog=pubs;Integrated Security=SSPI;"
Is there any way to make this connection string generic so that it can stay
the same between different machines?
Thanks
MaccaIf you run your application on the same machine as the database, . (period)
works as a server name. So if your install SQL Express with the default
instance name, the server name is .\SQLEXPRESS
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Macca" <Macca@.discussions.microsoft.com> wrote in message
news:B0A6D9FF-6715-4BBD-83BB-0C8B1F9A7098@.microsoft.com...
> Hi,
> My C# app uses SQL Server 2005 Express edition.
> I store my connection string in a config file.
> My application will run on numerous machines and therefore the machine
> name
> will be different each time. What I would like is a generic connection
> string
> so that I don't have to change it each time I install my app on a
> different
> machine.
> I therefore want to avoid specifing the machine name in the connection
> string as shown below :-
> "Data Source=MachineName;Initial Catalog=pubs;Integrated Security=SSPI;"
> Is there any way to make this connection string generic so that it can
> stay
> the same between different machines?
> Thanks
> Macca