Solved

ping sql servername

Posted on 2007-03-17
13
3,821 Views
Last Modified: 2010-03-28
i have sql 2005 installed on Laptop its only a development copy
I have my servername as computername\sqlinstance

when i ping computername\sqlinstance nothing returned

I look in cliconfg.exe and do not see alias .......

Is there something i need to set so i can ping my sql server on my laptop
Name pipes set
0
Comment
Question by:TRACEYMARY
  • 6
  • 5
  • 2
13 Comments
 
LVL 16

Expert Comment

by:rboyd56
ID: 18741107
You cannot ping the instance name. You can only ping the computer name (or ip address).

Ping does not understand the concept of an instance.

Why do you want to ping the sql server?
0
 
LVL 11

Expert Comment

by:andrewbleakley
ID: 18741474
try a vb script that will open a connection to the server instance something like
-----
Dim Connection
Dim ConnString
Dim SQL
On Error Resume Next
'define the connection string, specify database driver
ConnString="DRIVER={SQL Server};SERVER=HOMER;UID=sa;" & _
"PWD=as;DATABASE=AdManger"

'declare the SQL statement that will query the database
SQL = "SELECT * FROM TABLE_NAME"

'create an instance of the ADO connection and recordset objects
Set Connection = CreateObject("ADODB.Connection")

'Open the connection to the database
Connection.Open ConnString
if err.Number > 0 Then
  WScript.Echo "Connection Failed : " & Err.Description
else
  WScript.Echo "Connection fine"
end if
Connection.Close
Set Connection = Nothing
0
 
LVL 7

Author Comment

by:TRACEYMARY
ID: 18742979
I was trying to use bcp from sql and it keeps giving me the
Error = [Microsoft][ODBC SQL Server Driver]Cannot generate SSPI context
I looked around it said to try and ping computer

0
 
LVL 11

Expert Comment

by:andrewbleakley
ID: 18743018
have you tried everything in this http://support.microsoft.com/kb/811889
ping the name of he server that sqk is running on not th instance name
0
 
LVL 16

Expert Comment

by:rboyd56
ID: 18744826
The cannot generate SSPI context error is caused by an invalid Service Principle Name (SPN) for SQL Server. MOre than like the SPN is assigned for an older service account, like the system account, and never got updated when the service account was changed.

Download the setspn utility from this site:

http://www.microsoft.com/downloads/details.aspx?familyid=5fd831fd-ab77-46a3-9cfe-ff01d29e5c46&displaylang=en

At command prompt run these commands:

Setspn -L <SQL Server machine name>

Setspn -L <ql server service account>

Post the results to both of these commands. They do not have to be run on the SQL Server itself, but have to be run on a machine in the same domain.
0
 
LVL 16

Expert Comment

by:rboyd56
ID: 18744834
You can also use BCP passing the -U and -P parameters. This will use SQL Server authenication which will avoid the error as well. The error only occrs when TCP/IP and NT authentication is used.

So you can also change you client machine to use named pipes as well to avoid the error.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 7

Author Comment

by:TRACEYMARY
ID: 18745208
SQL 2005

Setspn -L <SQL Server machine name>
Setspn -L <ql server service account>

comes back with invalid command

i put in the name of computer on first

Used bcp command with username and password
(i know the bcp is supported in 2005 and the sqlcmd replaces so just using the bcp that i know)

SQLState = 08001, NativeError = 17
Error = [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not exist or access denied.
SQLState = 01000, NativeError = 2
Warning = [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (Connect()).
NULL

All services are started with local system account
shared memory enabled
named pipes enabled
tcp ip enabled

client protocols all enabled 1 shared memory, 2 tcp/ip 3, named pipes, 4 via

0
 
LVL 16

Expert Comment

by:rboyd56
ID: 18745784
What is your BCP command?

Did you download setspn and install it before you ran the command?

BTW: sqlcmd is a substitute for OSQL, not bcp.

Sounds like the server parameter you specified was not correct.


0
 
LVL 7

Author Comment

by:TRACEYMARY
ID: 18747956
in 2005 i have
Just create a new login with sa rights

declare @filename varchar(250)
declare @bcpcommand varchar(2000)
set @filename = 'C:\ET_CHRGL.txt'

SET @BCPCOMMAND = 'bcp "SELECT  * FROM TRACEY.DBO.TEST" queryout "'
set @bcpcommand = @bcpcommand  + @filename + '" -U BCPUser -P BCPUser -c -t "," -r "\n"'

exec master.dbo.xp_cmdshell @bcpcommand

usually i have -S ServerName

Get
SQLState = 08001, NativeError = 17
Error = [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not exist or access denied.
SQLState = 01000, NativeError = 2
Warning = [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (Connect()).
NULL
0
 
LVL 16

Accepted Solution

by:
rboyd56 earned 500 total points
ID: 18748161
This BCP command does not have a server name:

SET @BCPCOMMAND = 'bcp "SELECT  * FROM TRACEY.DBO.TEST" queryout "'
set @bcpcommand = @bcpcommand  + @filename + '" -U BCPUser -P BCPUser -c -t "," -r "\

If you add the server name do you still get the error?

You can also creat a TCP?IP alias and see if that works. That would indicate a problem with the shared memory library.
0
 
LVL 7

Author Comment

by:TRACEYMARY
ID: 18752714
Still get the error with servername and then using U and p
Memory library error hmm...where can i fix this.

You been helping me out lately ha, never a dull moment at my place last friday was disk error then replication,...this is just an install of 2005 lol

Keeps me busy
0
 
LVL 16

Expert Comment

by:rboyd56
ID: 18753154
Did you try creating a tcp/ip alias on the server?
0
 
LVL 7

Author Comment

by:TRACEYMARY
ID: 18768130
I try as soon as my pc responds..it crashed yesterday.
Not a good week.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now