In SQL server 2014, I try to invoke a sql script using command line:
~ osql -U sa -P passwd -i script.sql
and I get an error message: Login failed for user 'sa' OS Error 997 Overlapped I/O operation is in progress.
However, when I run the command in interactive mode:
~ osql -U sa -i script.sql
it asks for password and the command succeeds. Can someone please help me how to run sql scripts purely from command line without user intervention?
thanks.
Error 997. Overlapped I/O operation is in progress: KB2918614 breaks Windows Installer Service Hope this would help. If issue still persists post back with the information required, current status of your computer and result of the proposed suggestion, we will be happy to assist you. Ramesh Kumar.
No longer applicable starting with SQL Server 2017. Specifies the password for the startup account for Reporting Services service. This parameter can be omitted when using a managed service account, virtual account, or built-in account. No longer applicable starting with SQL Server 2017.
If the SQL Server Startup account is a Local User Account on the computer, open Computer Management (compmgmt.msc), and reset the password of the local user. If the SQL Server Startup account is a Windows Domain Account, open Active Directory Users and Computers, and then change the credentials.
The error message entry indicates that the current login name or password set is incorrect. To verify the same, you can use the Run-As Windows option to open a Windows Command Prompt window, and then provide the same credentials. If that works without any issues, carefully type the credentials in SQL Server Configuration Manager.
I just ran into a 997 error when using osql as well. It would appear that osql is not reporting errors correctly, giving error 997 instead of a more helpful error. Presumably this is due to it being deprecated.
In my case, the actual cause was the Server Authentication mode being set to "Windows Authentication mode" rather than "SQL Server and Windows Authentication mode". This can be changed by connecting using SQL Server Management Studio and going into the top level properties for the connection, then selecting the Security page.
Additionally, I had to enable the sa login, via Security -> Logins -> sa -> right click -> Properties on the Object Explorer, then setting the login to Enabled using the Status page.
This happened to me, and it came down to the wrong password.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With