Showing posts with label failed. Show all posts
Showing posts with label failed. Show all posts

Saturday, February 25, 2012

Communication Link Failure

Dear experts~
My client workstation recently receives "ODBC failed -
Connection bluh bluh bluh... SQL Server: Communication
Link Failure" error message while trying to insert/update
a record. This happens on two workstations. This problem
would soon go away in few seconds and come back few hours
latter. What's interesting is when users reported
Communication Link Failure, I am still able to connect to
the SQL Server through other workstations.
I checked my Network Config. Both TCP and Name Pipes are
enabled. My server runs well for a longest time and I
haven't make any changes on Configs recently. I'd like to
know what would cause this problem occurs and Could this
be a result of Bad Network Connection rather than SQL
Server Config. Or, What I can do on SQL Server to get
rid of this problem.
I am running SQL Server 2000 SP2. The client workstion
uses MS Access .mdb file with linked table to connect to
SQL Server 2000.
Thank you soooooo much for your help~~~
Annie
.Annie,
More than likely you have a network error. I say this because the error is confined to 2 workstations and you are able to access the server from your workstation. A couple of things to try:
you can do a simple test of the network connection by using the ping command. Use the -n parameter to send a large number of echo requests. Pay attention to the statistics on lost packets and round-trip time.
If packets are being lost or the returns times are higher check the event logs on the workstations with the problems for network related software or hardware problems.
Make sure you are not having any DNS problems. Check if you can consistently link to the server by specifying the server ip address in the ODBC Datasource defintion
My experience with Named Pipes is that it can be slow on a tcp/ip network. I would configure the ODBC Datasource defintions to use only tcp/ip.
Good Luck
Lewis DiFelice
DBA
-- piyomeme@.yahoo.com wrote: --
Dear experts~
My client workstation recently receives "ODBC failed -
Connection bluh bluh bluh... SQL Server: Communication
Link Failure" error message while trying to insert/update
a record. This happens on two workstations. This problem
would soon go away in few seconds and come back few hours
latter. What's interesting is when users reported
Communication Link Failure, I am still able to connect to
the SQL Server through other workstations.
I checked my Network Config. Both TCP and Name Pipes are
enabled. My server runs well for a longest time and I
haven't make any changes on Configs recently. I'd like to
know what would cause this problem occurs and Could this
be a result of Bad Network Connection rather than SQL
Server Config. Or, What I can do on SQL Server to get
rid of this problem.
I am running SQL Server 2000 SP2. The client workstion
uses MS Access .mdb file with linked table to connect to
SQL Server 2000.
Thank you soooooo much for your help~~~
Annie
..

Friday, February 24, 2012

Communicate with Service Broker in C#?

So SQLDependencies failed to do what I wanted them to do for my Cache Invalidating, so i'm going to humor another possibility for a half day - Triggers on my database table that communicate messages to my C# inside my ASP.NET App. Any advice on how to tap into a message queue with C#? I'm thinking that my messages could be 1 of about 100 different strings as far as what occurred on the Database Tables

have u heard of managed code?

your trigger can communicate with C# in managed code......

STEP 1)Write an assembly
using System.Data;
using System.Data.Sql;
using System.Data.SqlServer;
public class Test
{
public static void InsertTrigger()
{
SqlTriggerContext triggerContext = SqlContext.GetTriggerContext();
SqlPipe sqlPipe = SqlContext.GetPipe();
SqlCommand command = SqlContext.GetCommand();
if (triggerContext.TriggerAction == System.Data.Sql.TriggerAction.Insert)
{

try
{

//C# communication code here

}
catch (Exception e)
{

//EXCEPTION HANDLING CODE

}
}
}
}

STEP 2)Register the assembly in the database
CREATE ASSEMBLY Test FROM 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\Test\CLRProcedures\CS\Test.dll'

STEP 3)Create the trigger
CREATE TRIGGER InsertTrigger
ON Table FOR INSERT
AS
EXTERNAL NAME
[Name of the Assembly]:[Name of the Class]::[Name of the Method]

|||I know that you can run managed code from SQL 2005 triggers, but the " //C# communication code here" is what i'm wondering about. Would that be the service broker? or TCP/IP? or what?|||

"//C# communication code here"

instead of this comment put code from here......

http://www.codeproject.com/cs/internet/smartmassemail.asp

Sunday, February 12, 2012

command line local login to SQL failed

Pardon if this has been asked before. If so, please post the URL.
Could someone please tell me how to fix this login/pipe? Notice the 3rd
login is fine with "/E". It is a SQL2005 Enterprise on Win2003 Server Ent.
C:\Program Files\Microsoft SQL
Server\90\NotificationServices\9.0.242\Bin>osql /
SMIAMI /U junk
Password:
Login failed for user 'junk'. The user is not associated with a trusted SQL
Server connection.
C:\Program Files\Microsoft SQL Server\90\Tools\Binn> osql /SMIAMI /U junk
Password:
[SQL Native Client]Shared Memory Provider: No process is on the other en
d of
the pipe.
[SQL Native Client]Communication link failure
C:\Program Files\Microsoft SQL Server\90\Tools\Binn>osql /SMIAMI /E
1> use adventureworks
2> go
1> select count (*) from person.address
2> go
19614
(1 row affected)It appears that SQL Server is set for Windows Authentication and that you
are attempting to login using SQL Authentication (Username/Password).
If you must use SQL Authentication, you need to change the authentication
mode of the server.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"light_wt" <lightwt@.discussions.microsoft.com> wrote in message
news:2A01AFB3-3447-46CA-B69B-BA527E620F3D@.microsoft.com...
> Pardon if this has been asked before. If so, please post the URL.
> Could someone please tell me how to fix this login/pipe? Notice the 3rd
> login is fine with "/E". It is a SQL2005 Enterprise on Win2003 Server
> Ent.
> C:\Program Files\Microsoft SQL
> Server\90\NotificationServices\9.0.242\Bin>osql /
> SMIAMI /U junk
> Password:
> Login failed for user 'junk'. The user is not associated with a trusted
> SQL
> Server connection.
> C:\Program Files\Microsoft SQL Server\90\Tools\Binn> osql /SMIAMI /U junk
> Password:
> [SQL Native Client]Shared Memory Provider: No process is on the other
end
> of
> the pipe.
> [SQL Native Client]Communication link failure
> C:\Program Files\Microsoft SQL Server\90\Tools\Binn>osql /SMIAMI /E
> 1> use adventureworks
> 2> go
> 1> select count (*) from person.address
> 2> go
> --
> 19614
> (1 row affected)|||Hi,
Go to SQL Server program groups, select SQL Server management studio.After
connecting to SQL Server instance do;
1. Right click above server
2. Select properties
3. Select Security option and click the option button, SQL Server and
Windows authentication
4.click ok and restart SQL Server
After this you wil be able to connect using SQL Authentication.
Thanks
Hari
SQL Server MVP
"light_wt" <lightwt@.discussions.microsoft.com> wrote in message
news:2A01AFB3-3447-46CA-B69B-BA527E620F3D@.microsoft.com...
> Pardon if this has been asked before. If so, please post the URL.
> Could someone please tell me how to fix this login/pipe? Notice the 3rd
> login is fine with "/E". It is a SQL2005 Enterprise on Win2003 Server
> Ent.
> C:\Program Files\Microsoft SQL
> Server\90\NotificationServices\9.0.242\Bin>osql /
> SMIAMI /U junk
> Password:
> Login failed for user 'junk'. The user is not associated with a trusted
> SQL
> Server connection.
> C:\Program Files\Microsoft SQL Server\90\Tools\Binn> osql /SMIAMI /U junk
> Password:
> [SQL Native Client]Shared Memory Provider: No process is on the other
end
> of
> the pipe.
> [SQL Native Client]Communication link failure
> C:\Program Files\Microsoft SQL Server\90\Tools\Binn>osql /SMIAMI /E
> 1> use adventureworks
> 2> go
> 1> select count (*) from person.address
> 2> go
> --
> 19614
> (1 row affected)