Member_2_6492660_1
asked on
SQLCMD no working n SQL 2014 Clster Server
SQL 2014 Enterprise Cluster
Windows2012 R2 Cluster Servers
Cannot get sqlcmd to run
PS C:\Windows\system32> sqlcmd -d master -Q "EXECUTE dbo.DatabaseBackup @Databases = 'Master', @Directory = 'F:\SQL-BackupData\', @BackupType = 'FULL', @Verify = 'Y', @CleanupTime = 672" -b >>$LogFolder\$LogFile
sqlcmd : Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server [2]. .
At line:1 char:1
+ sqlcmd -d master -Q "EXECUTE dbo.DatabaseBackup @Databases = 'Mast ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~
+ CategoryInfo : NotSpecified: (Sqlcmd: Error: ...L Server [2]. .:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server
is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books
That is running on the SQL Cluster server
From my windows 10 computer
Microsoft Windows [Version 10.0.16299.371]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>sqlcmd -S tgcs014-n1-sqlc -E
1> use {master}
2> go
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Syntax error, permission violation, or other nonspecific error.
1>
Any thoughts
Tom
Windows2012 R2 Cluster Servers
Cannot get sqlcmd to run
PS C:\Windows\system32> sqlcmd -d master -Q "EXECUTE dbo.DatabaseBackup @Databases = 'Master', @Directory = 'F:\SQL-BackupData\', @BackupType = 'FULL', @Verify = 'Y', @CleanupTime = 672" -b >>$LogFolder\$LogFile
sqlcmd : Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server [2]. .
At line:1 char:1
+ sqlcmd -d master -Q "EXECUTE dbo.DatabaseBackup @Databases = 'Mast ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Sqlcmd: Error: ...L Server [2]. .:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server
is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books
That is running on the SQL Cluster server
From my windows 10 computer
Microsoft Windows [Version 10.0.16299.371]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>sqlcmd
1> use {master}
2> go
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Syntax error, permission violation, or other nonspecific error.
1>
Any thoughts
Tom
In your client connect attempt, remove the curly braces.
ASKER
Thanks guys
Removing the curly braces worked from the client
Microsoft Windows [Version 10.0.16299.371]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>sqlcmd -S tgcs014-n1-sqlc -E
1> use master
2> go
Changed database context to 'master'.
1>
I also tried hat on my SQL Server and it worked
So the question now is why does this command not work from my SQL Server
sqlcmd -d master -Q "EXECUTE dbo.DatabaseBackup @Databases = 'Master', @Directory = 'F:\SQL-BackupData\', @BackupType = 'FULL', @Verify = 'Y', @CleanupTime = 672" -b >>$LogFolder\$LogFile
Removing the curly braces worked from the client
Microsoft Windows [Version 10.0.16299.371]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>sqlcmd
1> use master
2> go
Changed database context to 'master'.
1>
I also tried hat on my SQL Server and it worked
So the question now is why does this command not work from my SQL Server
sqlcmd -d master -Q "EXECUTE dbo.DatabaseBackup @Databases = 'Master', @Directory = 'F:\SQL-BackupData\', @BackupType = 'FULL', @Verify = 'Y', @CleanupTime = 672" -b >>$LogFolder\$LogFile
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
On the server you should not need to provide a server name or -E. Is the result of sqlcmd -L showing (local) and/or the server name?
ASKER
ADDing the -S tgcs014-n1-sqlc -E worked
Just strange that I need to add that when running from the sql server itself.
Thanks for all the help
Just strange that I need to add that when running from the sql server itself.
Thanks for all the help
Temporarily disable Windows Firewall and test your SQL script once more.