Accessing SQL Server from Batch File - not connecting -
i attempting execute queries sql server batch file. @ later date, using batch file send parameters these queries, now, trying use batch file execute.
the batch file looks this:
sqlcmd -s "servername"\"dbname" -i "query.sql"
and error message getting this:
sqlcmd: error: microsoft sql server native client 11.0 : sql server network inte rfaces: error locating server/instance specified [xffffffff]. . sqlcmd: error: microsoft sql server native client 11.0 : login timeout expired. sqlcmd: error: microsoft sql server native client 11.0 : network-related or in stance-specific error has occurred while establishing connection sql server . server not found or not accessible. check if instance name correct , f sql server configured allow remote connections. more information see sql server books online..
i have instance name of server correct, , know server has remote connection enabled. machine on same network server, , server responds when query through ssms. have tried connecting admin username , password, makes no difference.
edit: rbarryyoung pointed out, confused instance names database names.
try this:
sqlcmd -s "servername\instancename" -d "dbname" -i "query.sql" -e
also, looks confusing instance names database names, need sure which in sql server.
Comments
Post a Comment