I am using this query in bat file to back-up db,
sqlcmd -S .\MSSQLSERVER -E -Q "EXEC sp_BackupDb @backupLocation='D:\SQLBackups\', @databaseName='TestDb', @backupType='F'" pause
It is throwing this error,
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : SQL Server Network Inte rfaces: Connection string is not valid [87]. 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 in stance-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 i f SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
Can someone please help? Thanks in advance.