SQL Compare Command line vs UI database access
SuperMario
Posts: 3 New member
in SQL Compare
I'm writing a script to compare and sync up multiple database using filters by type of object.
when I run the script 2 out of 8 database return "Error: Cannot open database "xyz" requested by the login. The login failed. Login failed for user 'Domain\UserID'.
I'm using my Windows Authentication account. All other 6 databases have not problem.
But when I used the GUI version of SQL Compare, I can connect to all database and compare them all without issues.
when I run the script 2 out of 8 database return "Error: Cannot open database "xyz" requested by the login. The login failed. Login failed for user 'Domain\UserID'.
I'm using my Windows Authentication account. All other 6 databases have not problem.
But when I used the GUI version of SQL Compare, I can connect to all database and compare them all without issues.
Tagged:
Answers
If possible can you share your script so we can help investigate this issue?
To start looking into this we'd like to verify the script just to verify there isn't a scripting issue which we can help rectify quickly.
Are you able to also verify that the database is configured for Windows authentication and that the user you are trying to log into the database with has appropriate access permissions?
As stated originally, I'm using Windows Authentication, I have SysAdmin rights to the server/instance, I can access the database using windows authentication from SSMS and with SQL Compare GUI, but not from the command line.
the scripts I'm running look like this
I'm running compares for 11 databases, 3 times each using different filters. of the 11 database 2 give me error mentioned above, regardless of the filter they are running with.
Any suggestions are welcome
Thanks,
Mario Hernandez
Someone decided to change the spelling of these 2 databases to plural instead of single, which I didn't noticed on the GUI when selecting the databases, so the script was trying to connect to a non-existent database.
Please disregards this posting ( delete it if you can to protect the innocents )
Glad you found the culprit and were able to resolve the issue.
Thank you for posting up and sharing the details.