APHComputersLtd
asked on
[Microsoft][ODBC SQL Server Driver][SQL server]Cannot open database requested by the login. the login failed
Hi Dear Experts, I am facing the following error: [Microsoft][ODBC SQL Server Driver][SQL server]Cannot open database requested by the login. the login failed when i call the following command in sql2005, bcp [servername].[dbo].[tablen ame] out c:\T1Export.csv -w -t\t -S machinename-U sa -Ppassword.
the command works fine on my machine, but not on the customer site.
my machine is a development machine but on the customer machine i just have sql server ,no MS office and no MDAC. Do i need to install any thing. I very much appriciate any help. thanks.
the command works fine on my machine, but not on the customer site.
my machine is a development machine but on the customer machine i just have sql server ,no MS office and no MDAC. Do i need to install any thing. I very much appriciate any help. thanks.
ASKER
Hi Pcelba,
Thanks for your reply, I noticed that i had typing mistake in my question, it is databasename which i used after bcp.
re the sa user, i can login using sql authent. by user sa although when you look at the security\users node under the specified database i have users such as dbo,buildin administrators,,,,, but not sa explicityly. but the dbo loginnn. although i have the user sa declared under the selected server, please find attached snapshot. Hope this could give you some ideas about where the problem is.
Many thanks.
expert.bmp
Thanks for your reply, I noticed that i had typing mistake in my question, it is databasename which i used after bcp.
re the sa user, i can login using sql authent. by user sa although when you look at the security\users node under the specified database i have users such as dbo,buildin administrators,,,,, but not sa explicityly. but the dbo loginnn. although i have the user sa declared under the selected server, please find attached snapshot. Hope this could give you some ideas about where the problem is.
Many thanks.
expert.bmp
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The sa user doesn't have a red arrow next to it and it is enabled.
but i just come acoross the following :
When i run BCP master..sysobjects out c:\sysobjects.txt -c -t, -T , it works and creates the file but if i run bcp [HKTest].[dbo].[tbfinalrep ort] out c:\ScheduleReport.csv -c -t, -T , it does come up with a login failure. please see attached
expert2.bmp
but i just come acoross the following :
When i run BCP master..sysobjects out c:\sysobjects.txt -c -t, -T , it works and creates the file but if i run bcp [HKTest].[dbo].[tbfinalrep
expert2.bmp
ASKER
I forgot to tell you that i am doing RemoteDesktop to the customer site. As you probably noticed the bcp command that doesn;t have any -T switch does ask for a password but no matther whether i type in the windows administrator password or sql password it doesn't like it. I am sure it is something to do with the login set up on this server, please help . Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Interesting. Above syntax should be equivalent for SQL Server. But it is not true for bcp utility... I am learning instead of helping.
So, please assign your last comment as the accepted answer to preserve it for future references.
And thanks!
So, please assign your last comment as the accepted answer to preserve it for future references.
And thanks!
It should be:
"bcp [databasename].[dbo].[tabl
You may also look if the sa user is enabled.