Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

SQLCMD on SQL cluster

 
   Database Help (Home) -> Tools RSS
Next:  How to continue with inserts if violate unique in..  
Author Message
Brian Wilkins

External


Since: Nov 29, 2008
Posts: 1



(Msg. 1) Posted: Sat Nov 29, 2008 12:55 pm
Post subject: SQLCMD on SQL cluster
Archived from groups: microsoft>public>sqlserver>tools (more info?)

I developed a SQLCMD batch file that I run on a sql 2005 server . On the
single server copy of 2005 it works fine.

SQLCMD -U loginame -P ourpassword -i c:\IMMUNIZATION\Immune_Dump.sql -o
c:\IMMUNIZATION\DEM_DUMP.TXT -h -1 -Y 57


When I transferred it to a 2 server cluster of sql server 2005 I get the
following error.

HResult 0x2, Level 16, State 1
Named Pipes Provider: Could not open a connection to SQL Server [2].
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while
establishing a connection to the server. When connecting to SQL Server
2005, this failure may be caused by the fact that under the default
settings SQL Server does not allow remote connections..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.

I went through many of the steps for this error and they all seem to be
already set (ie tcp, named pipes etc...) - no luck

Any ideas?

thanks

Brian


*** Sent via Developersdex http://www.developersdex.com ***

 >> Stay informed about: SQLCMD on SQL cluster 
Back to top
Login to vote
Erland Sommarskog2

External


Since: May 30, 2004
Posts: 2061



(Msg. 2) Posted: Sat Nov 29, 2008 3:10 pm
Post subject: Re: SQLCMD on SQL cluster [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Brian Wilkins (bwilkins@daemen.edu) writes:
> I developed a SQLCMD batch file that I run on a sql 2005 server . On the
> single server copy of 2005 it works fine.
>
> SQLCMD -U loginame -P ourpassword -i c:\IMMUNIZATION\Immune_Dump.sql -o
> c:\IMMUNIZATION\DEM_DUMP.TXT -h -1 -Y 57
>
>
> When I transferred it to a 2 server cluster of sql server 2005 I get the
> following error.
>
> HResult 0x2, Level 16, State 1
> Named Pipes Provider: Could not open a connection to SQL Server [2].
> Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while
> establishing a connection to the server. When connecting to SQL Server
> 2005, this failure may be caused by the fact that under the default
> settings SQL Server does not allow remote connections..
> Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
>
> I went through many of the steps for this error and they all seem to be
> already set (ie tcp, named pipes etc...) - no luck

I guess you need to specify the server name with the -S option. This
is particularly obvious, if you run SQLCMD on one node in the cluster,
and SQL Server is right now running on the second.

But even if you run SQLCMD on the active node, I believe you need
to specify the server, as the server name is not the same as the
machine name.

--
Erland Sommarskog, SQL Server MVP, esquel RemoveThis @sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 >> Stay informed about: SQLCMD on SQL cluster 
Back to top
Login to vote
Brian Wilkins

External


Since: Dec 01, 2008
Posts: 1



(Msg. 3) Posted: Mon Dec 01, 2008 8:13 am
Post subject: Re: SQLCMD on SQL cluster [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

No luck - change the script to:
SQLCMD -S colldb1.datatel.daemen.edu -U datatel -P Hub8/TPO -i
c:\IMMUNIZATION\Immune_Dump.sql -o c:\IMMUNIZATION\DEM_DUMP.TXT -h -1 -Y 57

and I get the same error message.

"Erland Sommarskog" wrote:

> Brian Wilkins (bwilkins@daemen.edu) writes:
> > I developed a SQLCMD batch file that I run on a sql 2005 server . On the
> > single server copy of 2005 it works fine.
> >
> > SQLCMD -U loginame -P ourpassword -i c:\IMMUNIZATION\Immune_Dump.sql -o
> > c:\IMMUNIZATION\DEM_DUMP.TXT -h -1 -Y 57
> >
> >
> > When I transferred it to a 2 server cluster of sql server 2005 I get the
> > following error.
> >
> > HResult 0x2, Level 16, State 1
> > Named Pipes Provider: Could not open a connection to SQL Server [2].
> > Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while
> > establishing a connection to the server. When connecting to SQL Server
> > 2005, this failure may be caused by the fact that under the default
> > settings SQL Server does not allow remote connections..
> > Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
> >
> > I went through many of the steps for this error and they all seem to be
> > already set (ie tcp, named pipes etc...) - no luck
>
> I guess you need to specify the server name with the -S option. This
> is particularly obvious, if you run SQLCMD on one node in the cluster,
> and SQL Server is right now running on the second.
>
> But even if you run SQLCMD on the active node, I believe you need
> to specify the server, as the server name is not the same as the
> machine name.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel.RemoveThis@sommarskog.se
>
> Links for SQL Server Books Online:
> SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
> SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
> SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>
>
 >> Stay informed about: SQLCMD on SQL cluster 
Back to top
Login to vote
Russell Fields

External


Since: Jan 10, 2008
Posts: 608



(Msg. 4) Posted: Mon Dec 01, 2008 8:49 am
Post subject: Re: SQLCMD on SQL cluster [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Brian,

Erland is correct that you have to name the server, since a cluster does not
have (local) or ., etc.

You can also set up your SQL Agent job to use SQL Agent Tokens to name the
server. This works on clustered and non-clustered servers. E.g.

SQLCMD -S $(ESCAPE_SQUOTE(SRVR)) ...

RLF

"Brian Wilkins" wrote in message

>I developed a SQLCMD batch file that I run on a sql 2005 server . On the
> single server copy of 2005 it works fine.
>
> SQLCMD -U loginame -P ourpassword -i c:\IMMUNIZATION\Immune_Dump.sql -o
> c:\IMMUNIZATION\DEM_DUMP.TXT -h -1 -Y 57
>
>
> When I transferred it to a 2 server cluster of sql server 2005 I get the
> following error.
>
> HResult 0x2, Level 16, State 1
> Named Pipes Provider: Could not open a connection to SQL Server [2].
> Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while
> establishing a connection to the server. When connecting to SQL Server
> 2005, this failure may be caused by the fact that under the default
> settings SQL Server does not allow remote connections..
> Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
>
> I went through many of the steps for this error and they all seem to be
> already set (ie tcp, named pipes etc...) - no luck
>
> Any ideas?
>
> thanks
>
> Brian
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
 >> Stay informed about: SQLCMD on SQL cluster 
Back to top
Login to vote
Erland Sommarskog2

External


Since: May 30, 2004
Posts: 2061



(Msg. 5) Posted: Mon Dec 01, 2008 2:16 pm
Post subject: Re: SQLCMD on SQL cluster [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Brian Wilkins (Brian Wilkins.RemoveThis@discussions.microsoft.com) writes:
> No luck - change the script to:
> SQLCMD -S colldb1.datatel.daemen.edu -U datatel -P Hub8/TPO -i
> c:\IMMUNIZATION\Immune_Dump.sql -o c:\IMMUNIZATION\DEM_DUMP.TXT -h -1 -Y
> 57
>
> and I get the same error message.

I don't think that is the name of the server. That looks like something
that translates to an IP address, which again may or may not be the
machine the cluster service is running on right now.

Look up what @@servername returns and use that.

(And change the password you have now spread over the world.)

--
Erland Sommarskog, SQL Server MVP, esquel.RemoveThis@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
 >> Stay informed about: SQLCMD on SQL cluster 
Back to top
Login to vote
Geoff N. Hiten

External


Since: Jan 10, 2008
Posts: 111



(Msg. 6) Posted: Thu Dec 04, 2008 8:26 pm
Post subject: Re: SQLCMD on SQL cluster [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You have a FQDN for the server but not a SQL Instance name or the Virtual
server name.


--
Geoff N. Hiten
Principal SQL Infrastructure Consultant
Microsoft SQL Server MVP


"Brian Wilkins" wrote in message

> No luck - change the script to:
> SQLCMD -S colldb1.datatel.daemen.edu -U datatel -P Hub8/TPO -i
> c:\IMMUNIZATION\Immune_Dump.sql -o c:\IMMUNIZATION\DEM_DUMP.TXT -h -1 -Y
> 57
>
> and I get the same error message.
>
> "Erland Sommarskog" wrote:
>
>> Brian Wilkins (bwilkins@daemen.edu) writes:
>> > I developed a SQLCMD batch file that I run on a sql 2005 server . On
>> > the
>> > single server copy of 2005 it works fine.
>> >
>> > SQLCMD -U loginame -P ourpassword -i
>> > c:\IMMUNIZATION\Immune_Dump.sql -o
>> > c:\IMMUNIZATION\DEM_DUMP.TXT -h -1 -Y 57
>> >
>> >
>> > When I transferred it to a 2 server cluster of sql server 2005 I get
>> > the
>> > following error.
>> >
>> > HResult 0x2, Level 16, State 1
>> > Named Pipes Provider: Could not open a connection to SQL Server [2].
>> > Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred
>> > while
>> > establishing a connection to the server. When connecting to SQL Server
>> > 2005, this failure may be caused by the fact that under the default
>> > settings SQL Server does not allow remote connections..
>> > Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
>> >
>> > I went through many of the steps for this error and they all seem to be
>> > already set (ie tcp, named pipes etc...) - no luck
>>
>> I guess you need to specify the server name with the -S option. This
>> is particularly obvious, if you run SQLCMD on one node in the cluster,
>> and SQL Server is right now running on the second.
>>
>> But even if you run SQLCMD on the active node, I believe you need
>> to specify the server, as the server name is not the same as the
>> machine name.
>>
>> --
>> Erland Sommarskog, SQL Server MVP, esquel.TakeThisOut@sommarskog.se
>>
>> Links for SQL Server Books Online:
>> SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
>> SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
>> SQL 2000:
>> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>>
>>
 >> Stay informed about: SQLCMD on SQL cluster 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
SQLCMD issues - Hi folks I am having the following issue with SQLCMD script. Here's the script: :setvar x 0 print $(x) if $(x) = 1 begin print 'x=1' :exit(select $(x)) end else print 'x <> 1' My problem is that when SQLCMD encounters (or detects) the :exit...

SSMS 2005 on Vista SP1 can't find new named cluster instance - All, I have two Vista SP1 machines that have SSMS 2005 installed on them. These two machines (both used by developers) cannot see my new named SQL cluster instance when trying to connect using SSMS. Every other PC in the office with SSMS can find..

[MS Design Tools] - Class Not Registered - On a Windows 2000 pro workstation I am using SQL 2000 enterprise manager I am trying to return all rows, I get the error message "An unexpected error happened during this operation. [MS Design Tools] - Class not registered." I have reinstalle...

Exporting ToExcel file - Hi, I have a SP that adds an Excel file as a linked server, then tries to send the result of a query into this file. I get the following error : ------------ OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. Authentication failed. Insert..

Importing MS Access queries and relationships to MS SQL Se.. - Dear fellow programmers, I am having a big problem on how to import queries and relationships from MS Access to SQL Server. Any suggestions will be a great help & will be appreciated. Thanks in advance, Jeri
   Database Help (Home) -> Tools All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]