Solved

ping sql servername

Posted on 2007-03-17
13
3,870 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.

679 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