0

I have a SQL Server 2008 Express instance running and I can access the server with the default account sqlexpress using sqlcmd.

Now I have created a new windows account on the machine where SQL Server is running and created a login for sqlexpress using windows authentication. This account would be specifically used for backups.

When I try to login using the following and run the backup script (this backup script works fine for the default account sqlexpress)

sqlcmd -S (local)\mywinusr -i TestBkup.sql

I get the error

HResult 0xFFFFFFFF, Level 16, State 1
SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : 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 Online..
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired. tting login failed for the user.

What could be the problem?

cableload
  • 4,215
  • 5
  • 36
  • 62

1 Answers1

1

sqlcmd -S specifies a server, you have specified (local)\mywinusr. this suggests that you are passing in a username as an instance. your server name for sqlexpress should be:

(local)\sqlexpress

if you are logged inas this new user, then you just specify -E for 'trusted connection'

if you need to connect as, use

-U domain\username and -P password

hope this helps

Tom Beech
  • 2,289
  • 1
  • 21
  • 25
  • i have not logged on as that windows user..however if i use C:\Users\Administrator\Desktop>sqlcmd -S (local)\sqlexpress -U localuser -P password -i TestBkup.sql i am getting an error login failed for user domain\localuser – cableload Jan 04 '13 at 19:42
  • The documentation states that "If neither the -U option nor the -P option is specified, sqlcmd tries to connect by using Microsoft Windows Authentication mode. Authentication is based on the Windows account of the user who is running sqlcmd." What if i am not logged on as the user? how can i connect then? Thanks. – cableload Jan 04 '13 at 19:50
  • I was able to use runas command to start the command prompt as a different windows user and then run my sql server backups. It worked great. thanks for pointing to me in the right direction. – cableload Jan 04 '13 at 20:58