I am trying to automate a report that is generated from the database on Azure database server. I am using below script in the batch file but I get the error.
Script:
osql -U [email protected] -S aazdb01.c224.database.windows.net -P "Password" -s "|" -i "c:\Users\fl1\Desktop\script.sql" -o "c:\Users\fl1\Desktop\output.txt"
Error:
Cannot open server "company.edu" requested by the login. The login failed.
If I run the below script with 'Sqlcmd', I still get the error.
Script:
sqlcmd -S aazdb01.c224.database.windows.net -U [email protected] -P "Password" -s "|" -i "c:\Users\fl1\Desktop\script.sql" -o "c:\Users\fl1\Desktop\output.txt"
Error:
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Cannot open server "company.edu" requested by the login. The login failed..
Can anyone advise what is the issue here?
-G
switch. Read the requirement for using this switch in the help for sqlcmd here: learn.microsoft.com/en-us/sql/tools/… Both sqlcmd and the ODBC driver have to be fairly up to date.