June 27, 2008 at 9:57 am
Using osql on one server to connect to SQL2005 on another server.
osql -U
response says:
'Login failed for user
Checked the SQL server and is listed as the database owner and in the login list.
I've tripple checked all of the database, user, and password parms for osql.. but still i'm getting the error..
Any ideas??
Thanks in advance,
Roger
June 27, 2008 at 10:02 am
Sorry the command was
osql -U username -P password -S servername -d databasename
June 29, 2008 at 6:45 pm
Are you using a windows ID or SQL ID in OSQL -U and just a note, try using SQLCMd insted of OSQL as it will be removed in future versions.
Also, did you check the login is not ORPHANED.
Use Databasename
sp_change_users_login 'Report'
If it shows up in the Result, it is a Orphaned Login,
use sp_change_users_login 'update_one','loginname','loginname'
Maninder
www.dbanation.com
June 29, 2008 at 10:53 pm
osql -E should log you in automatically, however, if you don't want to use that and use another user then type osql -U username -P password
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply