tl121000
asked on
BCP [view] out c:\whatever.txt -c -t, -U [cred] -P[pw] not working
BCP will not work - I can not get a connection - any thoughts?
bcp "server.dbo.view for horizon" out "c:\mytest.txt" -c -t, -U [user] -P [pw]
The user is a a SQl server suthentication account with read access from the view.
SQLState = 37000, NativeError = 4060
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database requ
ested in login 'server'. Login fails.
bcp "server.dbo.view for horizon" out "c:\mytest.txt" -c -t, -U [user] -P [pw]
The user is a a SQl server suthentication account with read access from the view.
SQLState = 37000, NativeError = 4060
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database requ
ested in login 'server'. Login fails.
ASKER
same result - the user definitely has rights...
I tried sql authentication and windows authentication account - neither worked.
I tried sql authentication and windows authentication account - neither worked.
Did you try to connect with Query analyser?
Are you connecting locally if not try it on the server using Query analyzer...
Are you connecting locally if not try it on the server using Query analyzer...
ASKER
Local SQL database -
Make sure the Login has the access to the database.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Then
If you are running the BCP command on the server itself then you don't need to use -S parameter if not then use it but it is advisable to use -S parameter all the time...
Try the following code...
bcp "DBname.dbo.view for horizon" out "c:\mytest.txt" -SServerName -c -t, -U "user" -P "pw"