I'm trying to connect to my database via sqlcmd to run a query (sql file).
sqlcmd -s ServerName -E
Then I do a "USE MyDatabase -> GO"
Then I get this message
"Could not locate the entry in the sysdatabase for database 'MyDatabase'. No entry found with that name."
I can do a select * from sys.databases inside sqlcmd and I get the 4 system databases - but not any user ones. I can access everything just fine via management studio to the databases using the same windows auth - just not via sqlcmd. This acting the same for me for sql server 2005/2008/2008r2. All are patched and up to date.
Any ideas on how I can fix this?